WinHttp TLS connection in classic asp

I am trying to send payment data to SagePay, and since they disable SSL, it needs to be sent using TLS.

The code I have is as follows:

set httpRequest = Server.CreateObject("WinHttp.WinHttprequest.5.1") httpRequest.Open "POST", CStr(strPurchaseURL), false httpRequest.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" httpRequest.send strPost strResponse = httpRequest.responseText 

I was told that adding an option allows you to set the protocol used, but the only thing I found:

 httpRequest.option(9) = 2720 

which allows you to use TLS and SSL, but it can only be TLS, does anyone know what code should do, or is there something else that I should do.

0
source share
2 answers

Option 9 WinHttpRequestOption_SecureProtocols , which

SSL 2.0: 0x0008
SSL 3.0: 0x0020
Transport Layer Security (TLS) 1.0: 0x0080

So

 httpRequest.option(9) = &H80 
0
source

If you are on Windows Server 2003, you may have the same problem that I encountered - if you have access to the server, try to answer my own question here: fooobar.com/questions/1000675 / ... and look how you do it.

0
source

All Articles