Closed
Description
Steps to reproduce
Install powershell
Run any code/cmdlet that tries to validate ssl certificates through HttpClientHandler.ServerCertificateCustomValidationCallback
Expected behavior
Certificates are validated
Actual behavior
Error:
"One or more errors occurred. (The libcurl library in use (7.43.0) and its SSL backend ("SecureTransport") do not support custom handling of certificates. A libcurl built with OpenSSL is required.)"
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.0.0-alpha
PSEdition Core
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 3.0.0.0
GitCommitId v6.0.0-alpha.9
CLRVersion
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
The output of
otool -L /usr/local/microsoft/powershell/6.0.0-alpha.9/System.Net.Http.Native.dylib
/usr/local/microsoft/powershell/6.0.0-alpha.9/System.Net.Http.Native.dylib:
@rpath/System.Net.Http.Native.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 8.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
Note the path where libcurl is being loaded from.
If I manually patch it by running:
brew install curl --with-openssl
sudo install_name_tool -change /usr/lib/libcurl.4.dylib /usr/local/opt/curl/lib/libcurl.4.dylib /usr/local/microsoft/powershell/6.0.0-alpha.9/System.Net.Http.Native.dylib
Then it is ok.
This bug is more for corefx, but until it is fixed there it would be good to have some workaround for powershell.
cc @ffeldhaus