TLS/SSL in .net

2019-03-31 14:50发布

问题:

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

回答1:

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 :-)



回答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.



回答3:

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



标签: c# sockets ssl