由於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