Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Security / April 2006

Tip: Looking for answers? Try searching our database.

SSL with .NET 1.1

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott W Gifford - 21 Apr 2006 05:03 GMT
Hello,

I'm writing a client in c# for a server speaking a custom protcol over
SSL.  I'm using Visual Studio 2003, and .NET 1.1 (the client will
eventually also run on the .NET Compact Framework).

I can't find a reasonable way to open up an SSL connection to the
server.  I see that later versions of .NET have SslStream, which would
do the trick, but I don't see anything like that in Visual Studio's
help.  I see a few options for getting HTTPS URLs, but the protocol
I'm interfacing with isn't HTTP.

Am I missing something obvious?  How do I open a plain-vanilla SSL
socket and use it roughly the same way as a regular TCP socket?

Thanks!

----ScottG.
Joe Kaplan (MVP - ADSI) - 21 Apr 2006 14:45 GMT
If you are looking for built in SSL support at the sockets level in .NET
1.1, you won't find it.  SslStream is new in .NET 2.0.

To have this support in .NET 1.1, you would need to write your own P/Invoke
wrapper that implements something like SslStream using Schannel and SSPI
under the hood.  Alternately, you might look for another library that works
with .NET 1.1 that has this support as well.  I have no idea what to tell
you about compact framework support though.

Best of luck,

Joe K.

> Hello,
>
[quoted text clipped - 14 lines]
>
> ----ScottG.
Scott W Gifford - 21 Apr 2006 15:52 GMT
"Joe Kaplan \(MVP - ADSI\)" <joseph.e.kaplan@removethis.accenture.com> writes:

> If you are looking for built in SSL support at the sockets level in .NET
> 1.1, you won't find it.  SslStream is new in .NET 2.0.

Thanks for the quick answer.  My protocol was close enough to HTTP
that, with some truly embarrassing hacks on both ends, I was able to
trick a Web request object into doing my dirty work.  :-)

> To have this support in .NET 1.1, you would need to write your own P/Invoke
> wrapper that implements something like SslStream using Schannel and SSPI
> under the hood.  Alternately, you might look for another library that works
> with .NET 1.1 that has this support as well.  I have no idea what to tell
> you about compact framework support though.

Do you know if SslStream is supported in the Compact Framework for
.NET 2.0?  MSDN didn't say one way or the other, from what I could
find.

Thanks!

----Scott.
Joe Kaplan (MVP - ADSI) - 22 Apr 2006 00:02 GMT
I do not know the compact framework question, but I bet cross posting to one
of their groups will get the answer.  I'm glad you found a suitable hack to
piggyback on top of HTTP.

I would assume that you could do the same hack on the CF as they MUST have a
HttpWebRequest and some sort of SSL support, right?

Best of luck again :)

Joe K.

> "Joe Kaplan \(MVP - ADSI\)" <joseph.e.kaplan@removethis.accenture.com>
> writes:
[quoted text clipped - 21 lines]
>
> ----Scott.
Scott W Gifford - 28 Apr 2006 04:16 GMT
"Joe Kaplan \(MVP - ADSI\)" <joseph.e.kaplan@removethis.accenture.com> writes:

[...]

> I would assume that you could do the same hack on the CF as they MUST have a
> HttpWebRequest and some sort of SSL support, right?

Yes, with some small changes and a .NET CF bug workaround, my hack
worked on the Compact Framework.  I just finished debugging and
testing it.

----Scott.
Eugene Mayevski - 21 Apr 2006 17:48 GMT
Hello!
You wrote  on Fri, 21 Apr 2006 00:03:21 -0400:

SW> Am I missing something obvious?  How do I open a plain-vanilla SSL
SW> socket and use it roughly the same way as a regular TCP socket?

You can check SSLBlackbox ( http://www.eldos.com/sbb/net-ssl.php ), which
provides Socket-like classes with SSL support (both client and server).
These classes are available for .NET CF too.

With best regards,
Eugene Mayevski

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.