You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wrong symlink in CentOS8 Powershell 7.1.3 package #15029
You cannot just change the link for OpenSSL 1.0.x to point to the 1.1.x libraries. While it will get libmi to load you will be unable to use any TLS features due to the API and ABI difference on OpenSSL 1.0.x and the 1.1.x versions. This is the reason why the symlink is pointing to 1.0.x still.
please look at the output of the ls command. In the current 7.1.3 package libcrypto.1.0.0 is already linked to libcrypto.so.1.1.1. But version 1.1.1 is not found in /lib64 directory.
In /lib64 you find:
libcrypto.so.1.1 - that links to libcrypto.so.1.1.1g
libcrypto.so.1.1.1g - the original library
uncorrected I get following error:
#>$session = New-PSSession -ComputerName server-05 -Credential $cred -Authentication Negotiate
New-PSSession: This parameter set requires WSMan, and no supported WSMan client library was found. WSMan is either not installed or unavailable for this system.
After I corrected the link the WSMAN communication works fine.
So the symlink is pointing to an invalid location and adjusting it to the OpenSSL 1.1.x location gets the library to load. But the issue here is that libmi is compiled against OpenSSL 1.0.x not 1.1.x. These versions are not API and ABI compatible so even if you point the link to the a valid location on your host you will run across issues when it first tries to use something in that library. In your example it’s running over HTTP which doesn’t use OpenSSL, as soon as you target a https endpoint it will fail, maybe even segfault the entire process.
In reality the symlinks shouldn’t be pointing to OpenSSL 1.1.x in this package but rather where the OpenSSL 1.0.x ones. This is complicated by the fact that this OpenSSL version may not be available on more modern distros so you have to compile it yourself.
I've seen PSWSMan 2.1.0 Package in the Powershell Gallery. Is the OpenSSL Bug fixed, if I install this nuget Package, an exchange the libs. I checked the libmi.so and it is correctly linked against OpenSSL 1.1
But why libmi isn't compiled against OpenSSL 1.1.x in the CentOS8 rpm package?
Another team in Microsoft maintain the package and they no longer support PowerShell's use case so PowerShell is stuck with what was given to them at the time. Technically they could build it themselves and include it in the distribution but so far they haven’t gone that route.
I've seen PSWSMan 2.1.0 Package in the Powershell Gallery
Thats a fork of the libmi package that has been recompiled against OpenSSL 1.1.x on more modern systems. I’m actually the maintainer of that but there is no connection between myself and Microsoft so it isn’t supported here. I do recommend you use it because it fixes more problems than just OpenSSL, you can find more about it here https://github.com/jborean93/omi.
Thanks for providing all that context, Jordan Borean (@jborean93), and for your work on maintaining that fork of OMI. It's still not something we're feel comfortable taking into our package (largely due to lack of time on our side to review all of your changes), but I'm really glad it's out there for the folks that need it.
Given the symlink to an appropriately installed OpenSSL 1.0.x package, I'm going to close this one.
It's still not something we're feel comfortable taking into our package
Totally understandable, I had trouble myself trying to understand the existing codebase due to how complex it all is :) Looking forward to the pluggable transports slated for 7.2 which will hopefully make this even easier to distribute and install.
Joey Aiello (@joeyaiello) i think there is still an issue with the package here. The symlinks are pointing to the 1.1.x locations and even one of them does not exist. In reality they should either:
Point to the expected 1.0.x locations
Point to the correct 1.1.x locations
The first is what strictly should happen but it means OpenSSL 1.0.x must be installed for libmi to load at all. The latter will work for the http situation but will fail if a https endpoint is used, I.e. Exchange Online.
Thanks for the clarification. I was reading it as "we're linking to 1.0 and I have 1.1, and so 1.0 doesn't exist", but it looks like we're in a strange mixed state.
I think we should do the first of the two options you're presenting as HTTP endpoints probably shouldn't be used (and I think in the HTTPS we're very ungraceful in our error).
Is this CentOS8?
because in sourcecode of packaging.pm1 in case of CentOS 8 it is linked to 1.1
if ($Environment.IsRedHatFamily) {
switch -regex ($Distribution)
{
# add two symbolic links to system shared libraries that libmi.so is dependent on to handle
# platform specific changes. This is the only set of platforms needed for this currently
# as Ubuntu has these specific library files in the platform and macOS builds for itself
# against the correct versions.
'centos\.8' {
New-Item -Force -ItemType SymbolicLink -Target "/lib64/libssl.so.1.1" -Path "$Staging/libssl.so.1.0.0" > $null
New-Item -Force -ItemType SymbolicLink -Target "/lib64/libcrypto.so.1.1.1" -Path "$Staging/libcrypto.so.1.0.0" > $null
}
default {
New-Item -Force -ItemType SymbolicLink -Target "/lib64/libssl.so.10" -Path "$Staging/libssl.so.1.0.0" > $null
New-Item -Force -ItemType SymbolicLink -Target "/lib64/libcrypto.so.10" -Path "$Staging/libcrypto.so.1.0.0" > $null
}
Oh I'm really sorry I must have added the repo for rhel/7 so it was installing the EL7 rpm hence why the links were still pointing to 1.0. Please ignore that post and my comments in #15029 (comment) still stand.
Just as an FYI when the libssl and libcrypto links are pointing to OpenSSL 1.1.x here is the error you get when trying to connect to a HTTPS endpoint
pwsh: symbol lookup error: /opt/microsoft/powershell/7/libmi.so: undefined symbol: SSL_library_init
This faults the entire process and kicks you out of PowerShell which is definitely not ideal. Adds more weight to the argument that it should still be pointed to the OpenSSL 1.0.x libs and we continue to document that compat-openssl10 is required here.
Yep so that’s the 2nd option I mentioned. I don’t think it’s the right move though as it brings the whole PowerShell process down as soon as you target HTTPS endpoints. The symlinks should still be pointing to the OpenSSL 1.0.x libraries like it does on CentOS 7 and the docs updated to indicate compat-openssl10 is required for WSMan.
I'm also affected by this issue - pwsh as snap on Fedora 34:
➜ pwsh
PowerShell 7.1.3
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
No usable version of libssl was found
[1] 14902 IOT instruction (core dumped) pwsh
snap info
➜ snap list powershell
Name Version Rev Tracking Publisher Notes
powershell 7.1.3 160 latest/stable microsoft-powershell✓ classic
➜ snap info powershell
name: powershell
summary: PowerShell for every system!
publisher: Microsoft PowerShell✓
store-url: https://snapcraft.io/powershell
contact: https://github.com/powershell/powershell
license: unset
description: |
PowerShell is an automation and configuration management platform.
It consists of a cross-platform (Windows, Linux, and macOS)
command-line shell and associated scripting language.
See https://docs.microsoft.com/powershell/scripting/powershell-support-lifecycle for support
details.
commands:
- powershell
snap-id: JSNnoJl3EqkMuWoy5Dgq8PMqZ0uNcpie
tracking: latest/stable
refresh-date: 2021-04-04
channels:
latest/stable: 7.1.3 2021-03-12 (160) 68MB classic
latest/candidate: 7.1.3 2021-03-12 (160) 68MB classic
latest/beta: 7.1.3 2021-03-12 (160) 68MB classic
latest/edge: 7.1.3 2021-03-12 (160) 68MB classic
lts/stable: 7.0.6 2021-03-12 (161) 60MB classic
lts/candidate: 7.0.6 2021-03-12 (161) 60MB classic
lts/beta: 7.0.6 2021-03-12 (161) 60MB classic
lts/edge: 7.0.6 2021-03-12 (161) 60MB classic
installed: 7.1.3 (160) 68MB classic
Activity
[-]Wrong symlink in CentOS8 Powershell 7.1.3[/-][+]wrong symlink in CentOS8 Powershell 7.1.3 package[/+]jborean93 commentedon Mar 15, 2021
You cannot just change the link for OpenSSL 1.0.x to point to the 1.1.x libraries. While it will get libmi to load you will be unable to use any TLS features due to the API and ABI difference on OpenSSL 1.0.x and the 1.1.x versions. This is the reason why the symlink is pointing to 1.0.x still.
c-0815 commentedon Mar 16, 2021
Hi Jordan,
please look at the output of the ls command. In the current 7.1.3 package libcrypto.1.0.0 is already linked to libcrypto.so.1.1.1. But version 1.1.1 is not found in /lib64 directory.
In /lib64 you find:
uncorrected I get following error:
After I corrected the link the WSMAN communication works fine.
best regards
Ralph
jborean93 commentedon Mar 16, 2021
So the symlink is pointing to an invalid location and adjusting it to the OpenSSL 1.1.x location gets the library to load. But the issue here is that libmi is compiled against OpenSSL 1.0.x not 1.1.x. These versions are not API and ABI compatible so even if you point the link to the a valid location on your host you will run across issues when it first tries to use something in that library. In your example it’s running over HTTP which doesn’t use OpenSSL, as soon as you target a https endpoint it will fail, maybe even segfault the entire process.
In reality the symlinks shouldn’t be pointing to OpenSSL 1.1.x in this package but rather where the OpenSSL 1.0.x ones. This is complicated by the fact that this OpenSSL version may not be available on more modern distros so you have to compile it yourself.
c-0815 commentedon Mar 16, 2021
I understand. But why libmi isn't compiled against OpenSSL 1.1.x in the CentOS8 rpm package?
c-0815 commentedon Mar 16, 2021
I've seen PSWSMan 2.1.0 Package in the Powershell Gallery. Is the OpenSSL Bug fixed, if I install this nuget Package, an exchange the libs. I checked the libmi.so and it is correctly linked against OpenSSL 1.1
jborean93 commentedon Mar 16, 2021
Another team in Microsoft maintain the package and they no longer support PowerShell's use case so PowerShell is stuck with what was given to them at the time. Technically they could build it themselves and include it in the distribution but so far they haven’t gone that route.
Thats a fork of the libmi package that has been recompiled against OpenSSL 1.1.x on more modern systems. I’m actually the maintainer of that but there is no connection between myself and Microsoft so it isn’t supported here. I do recommend you use it because it fixes more problems than just OpenSSL, you can find more about it here https://github.com/jborean93/omi.
joeyaiello commentedon Mar 16, 2021
Thanks for providing all that context, Jordan Borean (@jborean93), and for your work on maintaining that fork of OMI. It's still not something we're feel comfortable taking into our package (largely due to lack of time on our side to review all of your changes), but I'm really glad it's out there for the folks that need it.
Given the symlink to an appropriately installed OpenSSL 1.0.x package, I'm going to close this one.
jborean93 commentedon Mar 16, 2021
Totally understandable, I had trouble myself trying to understand the existing codebase due to how complex it all is :) Looking forward to the pluggable transports slated for 7.2 which will hopefully make this even easier to distribute and install.
jborean93 commentedon Mar 16, 2021
Joey Aiello (@joeyaiello) i think there is still an issue with the package here. The symlinks are pointing to the 1.1.x locations and even one of them does not exist. In reality they should either:
The first is what strictly should happen but it means OpenSSL 1.0.x must be installed for libmi to load at all. The latter will work for the http situation but will fail if a https endpoint is used, I.e. Exchange Online.
joeyaiello commentedon Mar 17, 2021
Thanks for the clarification. I was reading it as "we're linking to 1.0 and I have 1.1, and so 1.0 doesn't exist", but it looks like we're in a strange mixed state.
I think we should do the first of the two options you're presenting as HTTP endpoints probably shouldn't be used (and I think in the HTTPS we're very ungraceful in our error).
jborean93 commentedon Mar 17, 2021
c-0815 commentedon Mar 17, 2021
Is this CentOS8?
because in sourcecode of packaging.pm1 in case of CentOS 8 it is linked to 1.1
jborean93 commentedon Mar 17, 2021
Oh I'm really sorry I must have added the repo for rhel/7 so it was installing the EL7 rpm hence why the links were still pointing to 1.0. Please ignore that post and my comments in #15029 (comment) still stand.
Just as an FYI when the libssl and libcrypto links are pointing to OpenSSL 1.1.x here is the error you get when trying to connect to a HTTPS endpoint
This faults the entire process and kicks you out of PowerShell which is definitely not ideal. Adds more weight to the argument that it should still be pointed to the OpenSSL 1.0.x libs and we continue to document that
compat-openssl10is required here.c-0815 commentedon Mar 18, 2021
But than the powershell devs should change die linking behavior I showed at my last post for CentOS8
jborean93 commentedon Mar 18, 2021
Yep so that’s the 2nd option I mentioned. I don’t think it’s the right move though as it brings the whole PowerShell process down as soon as you target HTTPS endpoints. The symlinks should still be pointing to the OpenSSL 1.0.x libraries like it does on CentOS 7 and the docs updated to indicate
compat-openssl10is required for WSMan.mmcnutt commentedon May 21, 2021
https://bugzilla.redhat.com/show_bug.cgi?id=1879707
Fedora is not packaging compat-openssl10 in Fedora 34. At the moment installing to Fedora 34 leaves WSMan broken
megamorf commentedon Jun 6, 2021
I'm also affected by this issue - pwsh as snap on Fedora 34:
snap info