VB 6.0 - ServerXMLHTTP - An error occured in the secure channel support

681 Views Asked by At
Public Sub GetAPIToken(aUserName As String, aPassword As String, aResponse As String)

    Dim WinHttpReq As Object

    Dim strURL As String, strJSON As String

    Set WinHttpReq = CreateObject("MSXML2.ServerXMLHTTP")

    strURL = "https://example.com/v1/users/login"

    strJSON = "{" _

                & Chr(34) & "username" & Chr(34) & ":" & Chr(34) & aUserName & Chr(34) & "," _

                & Chr(34) & "password" & Chr(34) & ":" & Chr(34) & aPassword & Chr(34) _

            & "}"
              
    With WinHttpReq

       .Open "POST", strURL, False

       .setRequestHeader "Content-Type", "application/json"

       .Send strJSON   **>> error on this line**

       aResponse = .responseText

    End With

    Set WinHttpReq = Nothing

End Sub

Error: -2147012739 (80072f7d) : An error occurred in the secure channel support

above code working fine on Windows 10 pc but this error came on Windows 7 pc

0

There are 0 best solutions below