3

Is there any (hopefully free/open source) code available that does native TLS/SSL communication? I do not speak about the HTTPListener/Client and WebRequest classes. I'd like to do raw TLS communication in my C# code.

Thanks in advance, Max

Matt Brindley
  • 9,739
  • 7
  • 47
  • 51
bot47
  • 1,458
  • 3
  • 18
  • 36

3 Answers3

5

Here's an article on codeproject, it also includes code for using OpenSSL.

Do you mind if I ask what you're trying to achieve? Just curious really; there's lots of high-level wrapper classes for this kind of thing so you don't normally need to work at this level (not that there's anything wrong with that :-)

Matt Brindley
  • 9,739
  • 7
  • 47
  • 51
  • I am planning to develop a universal network debugger for SSL/TLS connections. You could call it a mitm-attack tool, I rather call it a protocol analyzer or protocol debugger, as I do not intend to do illegal things using it. – bot47 May 30 '09 at 13:35
  • Aha I see, sounds interesting! – Matt Brindley May 30 '09 at 13:45
  • How would that be different than a tool such as Wireshark? If you want to do anything more active, using SSPI and/or openssl might not be helpful, as you will need to modify the actual TLS messages and libraries won't let you do it (definitely with SSPI). – Nasko Jul 05 '11 at 18:46
2

http://www.mentalis.org/soft/projects/ssocket/ - been using this in a commercial product for the last 5 years in .net 1.0, 2.0 and now 3.0. Very reliable, simple to use and stable.

headsling
  • 623
  • 3
  • 13
1

Built-in (as at time of writing) SslStream object makes this easy - see https://www.medo64.com/2014/09/client-authenticated-tls-in-c/

Kind Contributor
  • 17,547
  • 6
  • 53
  • 70