February 2019
Intermediate to advanced
626 pages
15h 51m
English
If a service has an invalid certificate, the best response is to fix the problem. When it is not possible or practical to address the real problem, a workaround can be created.
The approach described here applies to Windows PowerShell only. PowerShell Core does not include the ICertificatePolicy type.
This modification applies to the current PowerShell session and will reset to default behavior every time a new PowerShell session is opened.
The certificate policy used by the ServicePointManager may be replaced with a customized handler by writing a class (PowerShell, version 5) that replaces the CheckValidationResult method:
Class AcceptAllPolicy: System.Net.ICertificatePolicy { [Boolean] CheckValidationResult( ...Read now
Unlock full access