Jump to content

WinHttp Request using TLS 1.1 / 1.2


Ascer
 Share

Recommended Posts

Hello

Opertation Sys: Win7 x64

Problem: Connecting to webs using TLS 1.1 +

Description: WinHttp.WinHttpRequest.5.1 using TLS 1.0 by default, i need higher version to connect into some webs.

Dim $oHttp = ObjCreate("WinHTTP.WinHTTPRequest.5.1")

$oHttp.open ("GET", "https://howsmyssl.com/a/check", False)

$oHttp.Option(9) = 128 ; 128 - TLS 1.0, 512 - TLS 1.1, 2048 - TLS 1.2, 2056 - TLS 1.1 & TLS 1.2 

$oHttp.Send

ConsoleWrite($oHttp.responseText & @CRLF) ; at end of the respond you can check your TLS version. Mine is: {"tls_version":"TLS 1.0","rating":"Bad"}

Error: $oHttp.Option works only with parameter 128 (TLS 1.0) other values make error {Bad parameter}

Additional: I've done this tutorial about enabling TLS in registry: <link>

Thanks for support.

Ascer

Edited by Ascer
Link to comment
Share on other sites

  • 5 months later...

Hi.

I have the same problem but I have installed the system update mentioned above. The site is using TLS1.2.

$HttpObj.Option(9) = 0x0800 ; SSL 2.0 - 0x0008 ; SSL 3.0 - 0x0020; TLS 1.0 - 0x0080; TLS 1.1 - 0x0200; TLS 1.2 - 0x0800

That returns "bad parameter".

Some other suggestions?

Regards, Simpel

P.S.: Registry settings below are done too.

The SecureProtocols registry entry that has value 0xA80 for enabling TLS 1.1 and 1.2 should be added in the following paths:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings

 

Edited by Simpel
added registry settings
SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win_10   Build = 19044   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Link to comment
Share on other sites

Nevertheless it is working now. $HttpObj.Option(9) = 0x0800 is still throwing "bad parameter". But now I can delete this option completely and it is working.

Maybe the registry entries are more important than these options.

Regards, Simpel

SciTE4AutoIt = 3.7.3.0   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win_10   Build = 19044   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE     H:\...\AutoIt3      H:\...\AutoIt3\Include     (H:\ = Network Drive)

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...