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
RHEL 9 uses OpenSSL 3, which is causing issues when using the current RHEL 8 release of PowerShell.
The following Dockerfile installs PowerShell and attempts to install a Module from the PowerShell Gallery:
FROM quay.io/centos/centos:stream9
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo | tee /etc/yum.repos.d/microsoft.repo \
&& dnf -y upgrade --refresh \
&& dnf -y install powershell \
&& pwsh -Command "Install-Module -Name AzTable -Force"ENTRYPOINT ["/usr/bin/env"]
Note that it does not matter which module. They all fail with the following error message:
WARNING: Source Location 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0' is not valid.
Install-Package: Package 'AzTable' failed to download.
With verbose output, we get a little more detail and it becomes clear where the issue is:
ERBOSE: Acquiring providers for assembly: /opt/microsoft/powershell/7/Modules/PackageManagement/coreclr/netstandard2.0/Microsoft.PackageManagement.ArchiverProviders.dll
VERBOSE: Acquiring providers for assembly: /opt/microsoft/powershell/7/Modules/PackageManagement/coreclr/netstandard2.0/Microsoft.PackageManagement.NuGetProvider.dll
VERBOSE: Acquiring providers for assembly: /opt/microsoft/powershell/7/Modules/PackageManagement/coreclr/netstandard2.0/Microsoft.PackageManagement.MetaProvider.PowerShell.dll
VERBOSE: Acquiring providers for assembly: /opt/microsoft/powershell/7/Modules/PackageManagement/coreclr/netstandard2.0/Microsoft.PackageManagement.CoreProviders.dll
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AzTable'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'AzTable'.
VERBOSE: Performing the operation "Install-Module" on target "Version '2.1.0' of module 'AzTable'".
VERBOSE: The installation scope is specified to be 'CurrentUser'.
VERBOSE: The specified module will be installed in '/root/.local/share/powershell/Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'AzTable' with version '2.1.0' from the repository 'https://www.powershellgallery.com/api/v2'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AzTable'' for ''.
VERBOSE: InstallPackage' - name='AzTable', version='2.1.0',destination='/tmp/734365082'
VERBOSE: DownloadPackage' - name='AzTable', version='2.1.0',destination='/tmp/734365082/AzTable.2.1.0/AzTable.2.1.0.nupkg', uri='https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0'.
VERBOSE: The SSL connection could not be established, see inner exception.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0' for '2' more times
VERBOSE: The SSL connection could not be established, see inner exception.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0' for '1' more times
VERBOSE: The SSL connection could not be established, see inner exception.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0' for '0' more times
VERBOSE: Downloading package 'AzTable' failed, please make sure 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0' is accessable.
WARNING: Source Location 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0' is not valid.
This does not only affect PowerShell Gallery, but it is easy to reproduce this way.
Up until a few days ago, we used a workaround, were we locked openssl and openssl-libs to an older version:
I've just done some more testing and PowerShell supports OpenSSL 3 for me. It just uses the functionality in dotnet which has been in place since .NET 6 (what pwsh 7.2.x uses) dotnet/runtime#46526.
What is interested in that this works in the test container
Invoke-WebRequest https://httpbin.org/get
But this does not (what Install-Module is calling)
Invoke-WebRequest https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0# Invoke-WebRequest: The remote certificate is invalid because of errors in the certificate chain: NotSignatureValid
I've also verified that the OpenSSL 3.x libs are loaded in the process and it's not picking up any other ones that might be in the path
What is interesting is that openssl s_client -connect www.powershellgallery.com:443 works just fine with the cert that the PowerShell gallery exposes which tells me that potentially support for OpenSSL 3.x in dotnet still has some kinks left to work through. The issue dotnet/runtime#67304 seems to be quite closely related, they do say that .NET 6 shouldn't be affected but maybe it still is?
Thank you for investigating! You are right that it seems like not all SSL connections are affected, but it is definitely not exclusive to Install-Module. I believe (although I can't verify it at the moment) Invoke-Command with a Windows host as a target is was also affected.
PowerShell seems to at least try to use the installed openssl, but it seems like newer versions are causing issues (hence our workaround by locking it to an older one).
Yea I’ll have to try and investigate it some more, the latest pwsh preview which is based ok dotnet 7 should be good but it also has problems. There’s something up with the cert that the PSGallery uses which is acting differently in OpenSSL 3. All this happens in dotnet and it’s not really controlled by PowerShell but it is definitely something that should be investigated and fixed if need be.
FROM quay.io/centos/centos:stream9
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo | tee /etc/yum.repos.d/microsoft.repo \
&& dnf -y upgrade --refresh \
&& dnf -y install powershell-preview \
&& pwsh-preview -Command "Install-Module -Name AzTable -Force -Verbose"ENTRYPOINT ["/usr/bin/env"]
VERBOSE: Acquiring providers for assembly: /opt/microsoft/powershell/7-preview/Modules/PackageManagement/coreclr/netstandard2.0/Microsoft.PackageManagement.MetaProvider.PowerShell.dll
VERBOSE: Acquiring providers for assembly: /opt/microsoft/powershell/7-preview/Modules/PackageManagement/coreclr/netstandard2.0/Microsoft.PackageManagement.CoreProviders.dll
VERBOSE: Acquiring providers for assembly: /opt/microsoft/powershell/7-preview/Modules/PackageManagement/coreclr/netstandard2.0/Microsoft.PackageManagement.ArchiverProviders.dll
VERBOSE: Acquiring providers for assembly: /opt/microsoft/powershell/7-preview/Modules/PackageManagement/coreclr/netstandard2.0/Microsoft.PackageManagement.NuGetProvider.dll
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AzTable'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'AzTable'.
VERBOSE: Performing the operation "Install-Module" on target "Version '2.1.0' of module 'AzTable'".
VERBOSE: The installation scope is specified to be 'CurrentUser'.
VERBOSE: The specified module will be installed in '/root/.local/share/powershell/Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'AzTable' with version '2.1.0' from the repository 'https://www.powershellgallery.com/api/v2'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AzTable'' for ''.
VERBOSE: InstallPackage' - name='AzTable', version='2.1.0',destination='/tmp/1012252532'
VERBOSE: DownloadPackage' - name='AzTable', version='2.1.0',destination='/tmp/1012252532/AzTable.2.1.0/AzTable.2.1.0.nupkg', uri='https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0'.
VERBOSE: The SSL connection could not be established, see inner exception.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0' for '2' more times
VERBOSE: The SSL connection could not be established, see inner exception.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0' for '1' more times
VERBOSE: The SSL connection could not be established, see inner exception.
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0' for '0' more times
VERBOSE: Downloading package 'AzTable' failed, please make sure 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0' is accessable.
WARNING: Source Location 'https://www.powershellgallery.com/api/v2/package/AzTable/2.1.0' is not valid.
Install-Package: Package 'AzTable' failed to download.
It seems like there were (are?) some more issues related to openssl and RHEL 9. For example dotnet/runtime#70343. It seems like this particular fix was merged into .Net 6.0.7. Not sure which version the current release is using, but I suppose it's probably a little older.
That does seem quite relevant, considering it was only merged 13 days ago I would be surprised if 7.2.x has been updated to 6.0.7 (6.0.6 is also the latest in the GH releases page).
I don't suppose there is any way to find out if this fixes the issue by trying to build PowerShell against this unreleased .NET version, is there? 😄
We are currently stuck without a working PowerShell on RHEL 9...
For what it's worth https://pkgs.dev.azure.com also recreates the error:
Invoke-WebRequest https://pkgs.dev.azure.com# Invoke-WebRequest: The remote certificate is invalid because of errors in the certificate chain: NotSignatureValid
Which indicates that there are probably a lot more sites and services that don't work either.
Dockerfile for reference:
FROM quay.io/centos/centos:stream9
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo | tee /etc/yum.repos.d/microsoft.repo \
&& dnf -y upgrade --refresh \
&& dnf -y install powershell \
&& pwsh -Command "Invoke-WebRequest https://pkgs.dev.azure.com"ENTRYPOINT ["/usr/bin/env"]
If you can get a compiled build of dotnet including that version you should be able to replace the dll's for it in pwsh itself. There's a lot in there so it's not just a simple thing to do unless you know what to change unfortunately.
It looks like v7.3.0-preview.5 fixes the problem, which would hopefully mean that the backport to .NET 6 also fixes it. In the meantime, I will have to see if we can work with the preview version for now.
As far as I can see since 7.2.14 / 7.3.7 the packages are sent to the repo, thank you so much for making our lives easier!
I think this issue can be closed now.
Activity
hanneshayashi commentedon Jun 21, 2022
RHEL 9 uses OpenSSL 3, which is causing issues when using the current RHEL 8 release of PowerShell.
The following Dockerfile installs PowerShell and attempts to install a Module from the PowerShell Gallery:
Note that it does not matter which module. They all fail with the following error message:
With verbose output, we get a little more detail and it becomes clear where the issue is:
This does not only affect PowerShell Gallery, but it is easy to reproduce this way.
Up until a few days ago, we used a workaround, were we locked openssl and openssl-libs to an older version:
This version has since been removed from the DNF repo, which leaves us unable to build a container based on RHEL 9 / CentOS Stream 9.
[-]Distribution Support Request[/-][+]Distribution Support Request - RHEL 9[/+]jborean93 commentedon Jun 21, 2022
I've just done some more testing and PowerShell supports OpenSSL 3 for me. It just uses the functionality in dotnet which has been in place since .NET 6 (what pwsh 7.2.x uses) dotnet/runtime#46526.
What is interested in that this works in the test container
But this does not (what Install-Module is calling)
I've also verified that the OpenSSL 3.x libs are loaded in the process and it's not picking up any other ones that might be in the path
What is interesting is that
openssl s_client -connect www.powershellgallery.com:443works just fine with the cert that the PowerShell gallery exposes which tells me that potentially support for OpenSSL 3.x in dotnet still has some kinks left to work through. The issue dotnet/runtime#67304 seems to be quite closely related, they do say that .NET 6 shouldn't be affected but maybe it still is?hanneshayashi commentedon Jun 21, 2022
Thank you for investigating! You are right that it seems like not all SSL connections are affected, but it is definitely not exclusive to Install-Module. I believe (although I can't verify it at the moment) Invoke-Command with a Windows host as a target is was also affected.
PowerShell seems to at least try to use the installed openssl, but it seems like newer versions are causing issues (hence our workaround by locking it to an older one).
jborean93 commentedon Jun 21, 2022
Yea I’ll have to try and investigate it some more, the latest pwsh preview which is based ok dotnet 7 should be good but it also has problems. There’s something up with the cert that the PSGallery uses which is acting differently in OpenSSL 3. All this happens in dotnet and it’s not really controlled by PowerShell but it is definitely something that should be investigated and fixed if need be.
hanneshayashi commentedon Jun 21, 2022
This still gives me the same error:
kasini3000 commentedon Jun 22, 2022
mark , I will update the one-click install script as soon as the rpm package is available in package.microsoft.com.
one-click install powershell on linux
https://gitee.com/chuanjiao10/kasini3000_agent_linux
hanneshayashi commentedon Jun 22, 2022
Just for the record: I just tested it with the new 7.2.5 release and still get the same error.
hanneshayashi commentedon Jun 22, 2022
It seems like there were (are?) some more issues related to openssl and RHEL 9. For example dotnet/runtime#70343. It seems like this particular fix was merged into .Net 6.0.7. Not sure which version the current release is using, but I suppose it's probably a little older.
jborean93 commentedon Jun 22, 2022
That does seem quite relevant, considering it was only merged 13 days ago I would be surprised if 7.2.x has been updated to 6.0.7 (6.0.6 is also the latest in the GH releases page).
hanneshayashi commentedon Jun 22, 2022
I don't suppose there is any way to find out if this fixes the issue by trying to build PowerShell against this unreleased .NET version, is there? 😄
We are currently stuck without a working PowerShell on RHEL 9...
For what it's worth
https://pkgs.dev.azure.comalso recreates the error:Which indicates that there are probably a lot more sites and services that don't work either.
Dockerfile for reference:
jborean93 commentedon Jun 22, 2022
If you can get a compiled build of dotnet including that version you should be able to replace the dll's for it in pwsh itself. There's a lot in there so it's not just a simple thing to do unless you know what to change unfortunately.
hanneshayashi commentedon Jun 23, 2022
It looks like v7.3.0-preview.5 fixes the problem, which would hopefully mean that the backport to .NET 6 also fixes it. In the meantime, I will have to see if we can work with the preview version for now.
9 remaining items
lumarel commentedon Oct 12, 2023
As far as I can see since 7.2.14 / 7.3.7 the packages are sent to the repo, thank you so much for making our lives easier!
I think this issue can be closed now.
[-]Distribution Support Request - RHEL 9[/-][+][DSR] - RHEL 9 x64[/+]theJasonHelmick commentedon Oct 29, 2024
This package is now available at PMC. For more information see the PMC Readme:
https://packages.microsoft.com/docs/readme.txt
We are still working on the docker image pipeline. I will post an update when we have published
images to the MCR.
theJasonHelmick commentedon Jan 7, 2025
The RHEL 9 distribution is released to PMC and MCR.
microsoft-github-policy-service commentedon Jan 7, 2025
📣 Hey Hannes Hayashi (@hanneshayashi), how did we do? We would love to hear your feedback with the link below! 🗣️
🔗 https://aka.ms/PSRepoFeedback