Skip to main content

Application fails to call WinHTTP with HTTPS

  • October 19, 2017
  • 1 reply
  • 0 views

Fano Razafinimanana

Problem:

The same application that calls WinHTTP successfully with HTTP fails to work with HTTPS even if zero is returned (in ws-res on the example below):

INVOKE ws-winhttp "Open"
    USING z"POST"
          WS-CALL-HOST *> containing URL with HTTPS
          ws-boolfalse
    RETURNING ws-res

INVOKE ws-winhttp "Send"
    USING ws-vartext
    RETURNING ws-res

Solution:

There is no code change required.

As explained in the following Microsoft link, an update for Windows and setting up a registry key are required:
https://support.microsoft.com/en-gb/help/3140245/update-to-enable-tls-1.1-and-tls-1.2-as-a-default-secure-protocols-in-winhttp-in-windows

The program should work fine after adding DefaultSecureProtocols with the DWORD value of A00 in HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\WinHttp


#winHttp
#netexpress

1 reply

  • Rocketeer
  • 19312 replies
  • December 10, 2019

Problem:

The same application that calls WinHTTP successfully with HTTP fails to work with HTTPS even if zero is returned (in ws-res on the example below):

INVOKE ws-winhttp "Open"
    USING z"POST"
          WS-CALL-HOST *> containing URL with HTTPS
          ws-boolfalse
    RETURNING ws-res

INVOKE ws-winhttp "Send"
    USING ws-vartext
    RETURNING ws-res

Solution:

There is no code change required.

As explained in the following Microsoft link, an update for Windows and setting up a registry key are required:
https://support.microsoft.com/en-gb/help/3140245/update-to-enable-tls-1.1-and-tls-1.2-as-a-default-secure-protocols-in-winhttp-in-windows

The program should work fine after adding DefaultSecureProtocols with the DWORD value of A00 in HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\WinHttp


#winHttp
#netexpress

Hi Fano,

 

Try to search for this answer before. I already had this working under the name "info_rene"

 

FYI