Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. protected override WebRequest GetWebRequest(Uri address)
  2. {
  3. var request = base.GetWebRequest(address) as HttpWebRequest;
  4. request.ServerCertificateValidationCallback +=
  5. (sender, certificate, chain, sslPolicyErrors) => { return true; };
  6.  
  7. if (Certificate != null)
  8. {
  9. request.ClientCertificates.Add(Certificate);
  10. LAST_CERTIFICATE_HASH = string.Format("{0} client certificates, hash {1}",
  11. request.ClientCertificates.Count, Certificate.GetCertHashString());
  12. }
  13. if (SOAPAction != null)
  14. {
  15. request.Headers.Add("SOAPAction", SOAPAction);
  16. }
  17. return request;
  18. }
  19.  
  20. 2015-10-07 01:06:02.446: Certificate Hash: DCE9A718132403C7B8F1690EE7E4A6E1A99D2C74
  21. 2015-10-07 01:06:02.446: LAST_CERTIFICATE_HASH: 1 client certificates, hash DCE9A718132403C7B8F1690EE7E4A6E1A99D2C74
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement