title: VBA | WinHttpRequest.5.1 | Ignore SSL Error doesn't work anymore
body: <p>I'm using a WinHttpRequest.5.1 object to make some https requests on an excel 365 (16.0.11328.20562) vba script.</p>
  
  <p>I know that the certificate from server will occurs an error because the CN is wrong. Therefore I suppress this error with the option to ignore ssl errors. </p>
  
  <p>I swear the following code worked two weeks ago and now it throws this error:</p>
  
  <blockquote>
    <p><strong>runtime error -2147012727 (80072f89) certificate invalid</strong></p>
  </blockquote>
  
  <p>Here is the code (included: Microsoft WinHTTP Services, version 5.1 [winhttpcom.dll]):</p>
  
  <pre><code>Sub test()
  
     Dim url As String
     url = "https://someserver:5096/api/v1/$metadata"
  
     Dim winHttpReq As WinHttpRequest
     Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
  
     'Ignoriere SSL-Errors
     winHttpReq.Option(4) = 13056
  
     'I also tested
     'winHttpReq.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = SslErrorFlag_Ignore_All
     'winHttpReq.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = SslErrorFlag_CertCNInvalid
  
     winHttpReq.Open "GET", url, False
  
     winHttpReq.Send ("")
  
     Debug.Print winHttpReq.ResponseText
  
  End Sub
  </code></pre>
  
  <p>I don't understand why I get an certificate invalid error, although ssl-errors should be ignored.</p>
  
  <p>I hope you know why this happens and thank you in advance for your answers.</p>