Jaykul / Tunable-SSL-Validator

A .Net class and PowerShell module to enable best practices for SSL validation even with self-signed certificates.
BSD 2-Clause "Simplified" License
57 stars 14 forks source link

MacOS / Powershell Core support? #12

Open planetscripton opened 5 years ago

planetscripton commented 5 years ago

Does this module support PowerShell Core? It doesn't appear to be working for me on PowerShell 6.2.1 on MacOS.

Wasapl commented 4 years ago

Does not work for me on Powershell 6.2.2 on MacOS also. Here is trace:

Add-SessionTrustedCertificate -FilePath ./myca.crt -Domain mydomain.com
Exception calling "Import" with "1" argument(s): "X509Certificate is immutable on this platform. Use the equivalent constructor instead."
At /Users/wasa/.local/share/powershell/Modules/TunableSSLValidator/1.1.0/TunableSSLValidator.psm1:128 char:21
+                     $Certificate.import( (Convert-Path $FilePath) )
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : PlatformNotSupportedException

Exception calling "GetCertHashString" with "0" argument(s): "m_safeCertContext is an invalid handle."
At /Users/wasa/.local/share/powershell/Modules/TunableSSLValidator/1.1.0/TunableSSLValidator.psm1:134 char:17
+                 $Hash = $Certificate.GetCertHashString()
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : CryptographicException