C# .net 中的 TLS/SSL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/929720/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 03:26:27  来源:igfitidea点击:

TLS/SSL in .net

c#socketsssl

提问by bot47

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.

是否有任何(希望免费/开源)代码可用于本地 TLS/SSL 通信?我不谈论 HTTPListener/Client 和 WebRequest 类。我想在我的 C# 代码中进行原始 TLS 通信。

Thanks in advance, Max

提前致谢,马克斯

采纳答案by Matt Brindley

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

这是一篇关于 codeproject 的文章,它还包括使用 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 :-)

你介意我问你想要达到什么目标吗?真的很好奇;这种事情有很多高级包装类,所以你通常不需要在这个级别工作(并不是说这有什么问题:-)

回答by headsling

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.

http://www.mentalis.org/soft/projects/ssocket/- 在过去 5 年的 .net 1.0、2.0 和现在的 3.0 中一直在商业产品中使用它。非常可靠,使用简单且稳定。

回答by Todd

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

内置(在撰写本文时)SslStream对象使这变得容易 - 请参阅https://www.medo64.com/2014/09/client-authenticated-tls-in-c/