简体   繁体   English

C#OpenSSL在.Net Framework 4.0中实现TLS1.2

[英]C# OpenSSL to achieve TLS1.2 in .Net Framework 4.0

I have requirement to achieve TLS1.2 in .Net framework 4.0 using OpenSSL. 我要求使用OpenSSL在.Net framework 4.0中实现TLS1.2。

I searched a lot for same but unable to find the code snippet for use of OpenSSL to set TLS1.2 security protocol instead of existing way OR another possible way of adding OpenSSL into it 我搜索了很多相同但无法找到使用OpenSSL设置TLS1.2安全协议而不是现有方式的代码片段或将OpenSSL添加到其中的另一种可能方式

My requirement is: 我的要求是:

  1. Communicate to our web service using TLS1.2 (Send request and read response from web service) 使用TLS1.2与Web服务进行通信(从Web服务发送请求和读取响应)
  2. We can not upgrade machines to .Net framework 4.5, they have framework .Net 4.0 我们无法将机器升级到.Net framework 4.5,它们有框架.Net 4.0

Current code implementation is as below where we are allowed/have .Net framework 4.0 and above 当前的代码实现如下所示允许/拥有.Net framework 4.0及更高版本

var request = (HttpWebRequest)WebRequest.Create(strHostUrl);
            request.Method = "POST";                
            request.ContentType = "application/json";
            request.UserAgent = "Java/1.7.0_51";
            request.ContentLength = strRequest.Length;
            request.Proxy = null;
            request.KeepAlive = false;
            request.Timeout = intTimeoutInMS;
            request.ReadWriteTimeout = 3000;
            ServicePointManager.SecurityProtocol = (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072;

We are seeing for option of using OpenSSL to achieve TLS1.2. 我们看到了使用OpenSSL实现TLS1.2的选项。

Is it possible to achieve the same? 有可能实现同样的目标吗? Can anyone please provide some help on above question. 任何人都可以请求上述问题的一些帮助。

Now I have made that change in .net framework 3.5. 现在我在.net framework 3.5中做了这个改变。 Please download OpenSSL wrapper (1.0.2 a) and above and include that project to your solution and follow the below link. 请下载OpenSSL包装器(1.0.2 a)及以上版本,并将该项目包含在您的解决方案中,并按照以下链接进行操作。 https://www.openssl.org/docs/man1.0.2/ https://www.openssl.org/docs/man1.0.2/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM