Asp.net-Mvc-3
貝寶沙盒 MVC3
我正在為我正在製作的網站測試貝寶 API。昨晚一切正常,但今天再次執行時,我收到以下錯誤:
無法為具有權限“api-aa.sandbox.paypal.com”的 SSL/TLS 建立安全通道
有同樣的。嘗試改用http://api-3t.sandbox.paypal.com/。它幫助了我。我在這裡找到它:setExpressCheckout 和 SSL/TLS 錯誤
如果您沒有或未使用 API 證書,則應分別連接到 api-3t.paypal.com 或 api-3t.sandbox.paypal.com 以獲取 Live 或 Sandbox。
我已經和這個問題鬥爭了幾個小時了。在一年前使用帶有簽名的 SOAP API 編寫 PayPal Express 結賬集成後,它被擱置了(當時所有單元測試都通過了)。我今天回到錯誤:
無法為具有權限“api-3t.sandbox.paypal.com”的 SSL/TLS 建立安全通道
經過大量研究,我已經將我們實例中的問題隔離為預設
ServicePointManager.SecurityProtocol值System.Net.SecurityProtocolType.Ssl3 | System.Net.SecurityProtocolType.Tls,更新它以SecurityProtocolType.Tls12解決問題。ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;