Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore SSL certs on PowerShell core #11

Open
VincentBerger opened this issue Jun 13, 2019 · 1 comment
Open

Ignore SSL certs on PowerShell core #11

VincentBerger opened this issue Jun 13, 2019 · 1 comment

Comments

@VincentBerger
Copy link

The method you used to ignore SSL certs does not work on non-Windows platforms with PowerShell core, MacOS in my case, due to missing .Net dependencies. This is the error I'm getting on Mac:

add-type : (3,40): error CS0246: The type or namespace name 'ICertificatePolicy' could not be found (are you missing a using directive or an assembly reference?)
    public class TrustAllCertsPolicy : ICertificatePolicy {
                                       ^

If I remove all the code in Set-InsecureSSL, and use the -SkipCertificateCheck switch on the Invoke-RestMethod call in Invoke-OVGDRequest, then it works
See also PowerShell/PowerShell#1945

@rumart
Copy link
Collaborator

rumart commented Jun 14, 2019

That switch was introduced in Powershell 6. I need to support 5 (and desktop) so need to find a way to get around it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants