29 lines
801 B
Plaintext
29 lines
801 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
ServicePointManager.ServerCertificateValidationCallback =
|
|
Function(sender, certificate, chain, errors) True ' Noncompliant: trust all certificates
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
ServicePointManager.ServerCertificateValidationCallback =
|
|
Function(sender, certificate, chain, errors)
|
|
If Development Then Return True ' For development, trust all certificates
|
|
Return Errors = SslPolicyErrors.None AndAlso ValidCerts.Contains(certificate.GetCertHashString()) ' Compliant: trust only some certificates
|
|
End Function
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|