由于PayPal更新了他们的响应,我需要在.NET 3.5框架中的现有应用程序中将安全协议TLS更新为v1.2。 需要更改现有代码中的更改,我无法将应用程序更新到较新的框架。如何在.Net 3.5框架中实现安全协议TLS 1.2
6
A
回答
2
如果您在NET 3.5.1上,您可以选择应用汇总修补程序并应用注册表编辑来告诉.NET使用系统默认值。 More details here
如果您需要使用.NET 4.5 for TLS 1.2 & 1.1支持,并且至少需要在Windows Server 2008 R2上运行。
5
我使用VS 2008与.net 3.5.30729.4926。我所要做的就是:
添加进口:
Imports System.Security.Authentication
Imports System.Net
这添加到我的代码(C#):
public const SslProtocols _Tls12 = (SslProtocols)0x00000C00;
public const SecurityProtocolType Tls12 = (SecurityProtocolType)_Tls12;
ServicePointManager.SecurityProtocol = Tls12
VB.net版本:
Const _Tls12 As SslProtocols = DirectCast(&HC00, SslProtocols)
Const Tls12 As SecurityProtocolType = DirectCast(_Tls12, SecurityProtocolType)
ServicePointManager.SecurityProtocol = Tls12
Dim wbrq As HttpWebRequest
Dim wbrs As HttpWebResponse
Dim sw As StreamWriter
Dim sr As StreamReader
Dim strResult As String
'Create a new HttpWebRequest object.
wbrq = WebRequest.Create(strURL)
wbrq.Method = "POST"
wbrq.ContentLength = DataString.Length
wbrq.ContentType = "application/x-www-form-urlencoded"
'upload data
sw = New StreamWriter(wbrq.GetRequestStream)
sw.Write(DataString)
sw.Close()
'get response
wbrs = wbrq.GetResponse
sr = New StreamReader(wbrs.GetResponseStream)
strResult = sr.ReadToEnd.Trim
sr.Close()
相关问题
- 1. .NET安全协议TLS
- 2. 无法在C#中使用SslStream接受TLS 1.2协议和.net框架4.6
- 3. PowerShell的设置安全协议为TLS 1.2
- 4. 如何实现Three20框架的协议?
- 5. .Net框架4.6.1不默认为TLS 1.2
- 6. 任何PHP框架实现ODATA协议?
- 7. Paypal TLS 1.2和.NET 3.5兼容性
- 8. Zend AMF实现和AMF协议安全
- 9. TLS在游戏框架2.3.x版本1.2实现与Nginx的
- 10. WCF安全连接应该启动与TLS 1.2协议的连接
- 11. 实体框架(.NET 3.5)
- 12. 如何在.Net中实现安全性?
- 13. .NET - 安全框架.NET
- 14. 在wpa-supplicant中实现像EAP这样的安全协议
- 15. 在全公司范围内安装.Net 3.5 SP1框架
- 16. 一个Zend_Http_Client和TLS 1.2 Zend框架1
- 17. 在Vert.x上将SSL协议限制在TLS 1.2上
- 18. 实现在.net 3.5
- 19. 在Android 2.3.3上实现TLS 1.2
- 20. 如何在Ruby中实现INSTREAM协议?
- 21. 如何在MPI协议中实现MPI_Comm?
- 22. 如何实现协议
- 23. TLS 1.2支持仅取决于.NET框架的版本吗?
- 24. 安装.NET 3.5框架的问题
- 25. .NET 3.5框架中的ADO.NET实体框架和WCF
- 26. 下载.NET 3.5的实体框架
- 27. .NET 3.5 SP1和ADo.NET实体框架
- 28. 如何处理实体框架.NET 3.5中的N-N关系
- 29. Javaee中的SSL/TLS协议版本
- 30. 使用TLS 1.2协议的clojure https连接
您的链接被打破。 – Cullub