Guest User

Untitled

a guest
Jun 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. Public Sub TestCert()
  2. Dim myHTTP as New ServerXMLHTTP60
  3. Dim myURL as String
  4.  
  5. ' Open the connection to the secure server
  6. myHTTP.Open "GET", "https://server/finalpath", False
  7.  
  8. ' Attempt to set the correct client certificate
  9. ' I have also tried just the friendly name as well as
  10. ' LOCAL_MACHINEMycert friendly name'
  11. myHTTP.SetOption 3, "CURRENT_USERMycert friendly name"
  12.  
  13. ' Send request fails with "A certificate is required ..."
  14. myHTTP.Send
  15. End Sub
  16.  
  17. Dim apiConnection As New WinHttp.WinHttpRequest
  18.  
  19. ' Set the authentication settings
  20. apiConnection.SetClientCertificate "mycert"
  21.  
  22. apiConnection.Open "Get", "https://localhost:8443", False
  23. apiConnection.Send
Add Comment
Please, Sign In to add comment