0

I am connecting to a server via a proxy that requires a client certificate to authenticate. I can easily launch a browser from my script, utilizing an ssh tunnel already established in a browser. When I attempt to open a connection using Microsoft.XMLHTTP, I receive an error

Security certificate required to access this resource is invalid.

I am looking for one of two solutions:

  1. utilize a session that is already (manually) established in a browser
  2. send the client certificate (and PIN) via the script.

The logic that I'm currently using for this function is very simple:

Dim xHttp: Set xHttp = CreateObject("Microsoft.XMLHTTP")
Dim bStrm: Set bStrm = CreateObject("Adodb.Stream")
xHttp.Open "GET", "https://localhost:63619/ap_detail.xml?id=3502", False
xHttp.Send

With bStrm
    .Type = 1 '//binary
    .Open
    .Write xHttp.responseBody
    .SaveToFile "C:\xml\3502.xml", 2 '//overwrite
End With
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
  • [Maybe related](http://stackoverflow.com/a/9971056/1630171). – Ansgar Wiechers Aug 31 '16 at 22:08
  • Is this the issue you are having? ssh -p 63619 -o HostKeyAlias="remotemachine" localhost This will tell SSH to not check the "localhost" certificate, but rather that for "remotemachine". http://spencerstirling.com/computergeek/sshtunnel.html – Randy Schuman Sep 02 '16 at 07:28
  • This page has a good description of how SSL and SSH differ in the certificate setup. http://stackoverflow.com/questions/723152/difference-between-ssh-and-ssl-especially-in-terms-of-sftp-vs-ftp-over-ssl – Randy Schuman Sep 02 '16 at 08:07

0 Answers0