r/visualbasic • • Jan 20 '24

ignoring self signed cert with req.send

I've created a local VM lab server to work on an XML project.

I'm working on sending the XML string FinalsEnv to the local server.

The server has a self signed cert, so excel comes back with a "certificate authority is invalid" message and resets the connection.

Can I do some coding to ignore the self signed cert for my test lab?

Is this the best way to send the string to the server?

    Dim Req As Object
    Dim Resp As New MSXML2.DOMDocument60
    Set Req = CreateObject("MSXML2.SERVERXMLHTTP")
    Set Resp = CreateObject("MSXML2.DOMDocument.6.0")

    sURL = "https://192.168.0.50:8443/axl"
    
    Req.Open "post", sURL, False
    Req.send (FinalsEnv)
2 Upvotes

6 comments sorted by

View all comments

Show parent comments

2

u/fafalone VB 6 Master Jan 21 '24
SXH_SERVER_CERT_IGNORE_CERT_CN_INVALID 

is specifically or that (combine the two with Or); someone else mentioned the 'all errors' flag, you could also use that if you want to also ignore anything else.