Forum Discussion

prekar's avatar
prekar
Occasional Contributor
4 years ago
Solved

The certificate authority is invalid or incorrect- Web Testing

I need to get the redirected URL so wrote the following code but i get 

"JavaScript runtime error.
The certificate authority is invalid or incorrect"
while sending the request. I tried to enable certificate issues from TestComplete Settings and included code as well. But still it doesn't work.. 

/* Code...*/

function NavigateToFromUrl()
{
var address = "https://www.te**********";

// Create an aqHttpRequest object
var aqHttpRequest = aqHttp.CreateGetRequest(address);

 

let objXMLHTTP = Sys["OleObject"]("MSXML2.ServerXMLHTTP.3.0");
objXMLHTTP.setOption(2,13056);

// Send the request, get an aqHttpResponse object
var aqHttpResponse = aqHttpRequest.Send();

if (aqHttpResponse != null)
{
// Read the response data
Log.Message(aqHttpResponse.StatusCode); // A status code
Log.Message(aqHttpResponse.StatusText); // A status text
Log.Message(aqHttpResponse.GetHeader("Location"));//Navigated URL
}
}

Any help is appreciated. Thanks

  • prekar's avatar
    prekar
    4 years ago

    Thanks AlexKaras , My code is working. All it required to work was to restart my pc and its working.

    and as you said to ignore certificate issues, MSXML2.ServerXMLHTTP  object needs to be used

2 Replies

    • prekar's avatar
      prekar
      Occasional Contributor

      Thanks AlexKaras , My code is working. All it required to work was to restart my pc and its working.

      and as you said to ignore certificate issues, MSXML2.ServerXMLHTTP  object needs to be used