WinHTTP.WinHTTPRequest.5.1 does not work with PayPal sandbox after TLS 1.2

爱⌒轻易说出口 提交于 2019-11-28 08:50:47
ivaylo

My application is written in ASP classic and I use WinHttp.WinHttpRequest.5.1in place of MSXML2.ServerXMLHTTP.6.0. to post to paypal sandbox url.

What works for me is telling the WinHttp.WinHttpRequest.5.1 objec to use TLS 1.2:

Set

httpRequest = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
httpRequest.option (9) = 2720

All that on Windows Server 2012

Anton Palyok

This option:

httpRequest.option (9) = 2720

Works only in Windows 2012 and newer

System library "winhttp.dll" of Windows 2008 R2 has only record for TLS 1.0 what equal to:

httpRequest.option (9) = 128

The other values will drop an exception.

But I found a solution which requires only changes in registry, without any additional changes in code. See details here: Classic ASP Outbound TLS 1.2

I had the exact same issue, but rather than setting option(9) a.k.a WinHttpRequestOption_SecureProtocols I needed to add support for TLS 1.2 in WinHttp itself

See article below, where you can run "Easy Fix" or add registry keys manually

https://support.microsoft.com/en-gb/help/3140245/update-to-enable-tls-1-1-and-tls-1-2-as-a-default-secure-protocols-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!