Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The certificate authority is invalid or incorrect

Have called many restful services from asp before - but this one has me stumped. First my func looks like

Set objHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP") 
with objHTTP 
.open "post", x_posturl, False 
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.send x_xmlstr
end with

and the error returned is

msxml3.dll error '80072f0d' The certificate authority is invalid or incorrect

so, googled a bit and suggestion was to add line

.setOption 2, 13056

this gives error

msxml3.dll error '80072f0c' A certificate is required to complete client authentication

I then contacted service supplier and they suggested

Click on the certificate error next to the address bar, view the certificate, select Details, select Copy to File, and download it to a file. Install that into your trusted certificates on your server to stop the error appearing when trying to submit data.

So, tried that using instructions here - but still no joy, any help appreciated

like image 641
zima10101 Avatar asked Oct 23 '13 10:10

zima10101


1 Answers

It seems like the server located at x_posturl has a certificate that is misconfigured, or that your client computer doesn't contain/recognize the certificate's root authority (most likely). There are a few options to fix:

  1. Have them fix their certificate if it's misconfigured.
  2. If their certificate is valid, but with a root authority your machine doesn't recognize, then you need to install the root authority certificate locally.
  3. Instruct MSXML2.ServerXMLHTTP to ignore certificate errors, which appears to be answered here: VBA ServerXMLHTTP https request with self signed certificate
  4. Change x_posturl to start with http:// instead of https://— if it's supported by the provider. Would not recommend this in a production scenario though.

Can you share specifically what x_posturl is? We should be able to debug by looking at the SSL handshake.

like image 188
Jim Heising Avatar answered Oct 01 '22 04:10

Jim Heising