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
Support the Cert:/ PSDrive on non-Windows platforms #1865
Joey Aiello (@joeyaiello) What would an x509 cert provider do on a Linux machine?
Well, it could enumerate the certs in /etc/ssl, /etc/pki/tls , /system/etc/security/cacerts, but the semantics would need to be quite different than on windows to be useful.
In researching supported and unsupported features in .NET core's Web Cmdlets I discovered that the certificate stores are working in .NET on both Linux and macOS. they can be directly manipulated via the .NET APIs through pwsh. On Linux, the current user my store gets created in ~/.dotnet/corefx/cryptography/x509stores/my. on macOS it is using Apple's Security.Framework API.
Using the ClientCert.pfx in the WebListener, I can initialize the Linux CurrentUser\My store like so:
# Do some prep work$StoreName= [System.Security.Cryptography.X509Certificates.StoreName]
$StoreLocation= [System.Security.Cryptography.X509Certificates.StoreLocation]
$OpenFlags= [System.Security.Cryptography.X509Certificates.OpenFlags]
$Store= [System.Security.Cryptography.X509Certificates.X509Store]::new(
$StoreName::My,$StoreLocation::CurrentUser)
# Get a certificate$X509Certificate2= [System.Security.Cryptography.X509Certificates.X509Certificate2]
$CertPath= (Resolve-Path'ClientCert.pfx').Path
$Cert=$X509Certificate2::New($CertPath,'password')
# Open the store, Add the cert, Close the store.$Store.Open($OpenFlags::ReadWrite)
$Store.Add($Cert)
$Store.Close()
After doing that on Linux, I am able to use cert auth via thumbprint:
Andre Esteve (@andreesteve) this feature is not currently in any active plan and is just in the backlog. Since the provider currently relies on Win32 APIs and not .NET APIs, it's not a small work item. A PR would be gladly accepted :)
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 23, 2023
Activity
TravisEz13 commentedon Aug 18, 2016
What OS was this on?
DexterPOSH commentedon Aug 19, 2016
This was on an Ubuntu box.
TravisEz13 commentedon Aug 19, 2016
I don't think the Cert provider is currently supported on Ubuntu, but the drive probably shouldn't show up in that case.
DexterPOSH commentedon Aug 19, 2016
The Cert provider yields expected result in the below case on my Ubuntu host.
But it fails when the Get-ChildItem is run from the PSDrive itself.
joeyaiello commentedon May 24, 2017
The Certificate store is not currently supported on non-Windows platforms, and isn't in scope in the near future.
[-]Get-ChildItem from Cert:/ PSDrive[/-][+]Support the Cert:/ PSDrive on non-Windows platforms[/+]TravisEz13 commentedon May 24, 2017
Joey Aiello (@joeyaiello) What would an x509 cert provider do on a Linux machine?
Well, it could enumerate the certs in
/etc/ssl,/etc/pki/tls,/system/etc/security/cacerts, but the semantics would need to be quite different than on windows to be useful.markekraus commentedon Dec 8, 2017
In researching supported and unsupported features in .NET core's Web Cmdlets I discovered that the certificate stores are working in .NET on both Linux and macOS. they can be directly manipulated via the .NET APIs through pwsh. On Linux, the current user my store gets created in
~/.dotnet/corefx/cryptography/x509stores/my. on macOS it is using Apple'sSecurity.FrameworkAPI.Using the
ClientCert.pfxin theWebListener, I can initialize the LinuxCurrentUser\Mystore like so:After doing that on Linux, I am able to use cert auth via thumbprint:
Cert auth doesn't work at all on macOS, but, I can still manipulate and search the
CurrentUser\Mystore using the .NET APIs.I think this support should be readded for x-plat in 6.1.0.
6 remaining items
SidShaytay commentedon Jun 30, 2018
Related to *nix certificate activities, we need
Import-PfxCertificate. Added as a ticket @ #7213andreesteve commentedon Jul 21, 2019
Steve Lee (@SteveL-MSFT) - do you know if this feature is planed for a future release or just in the backlog for now? Thanks!
SteveL-MSFT commentedon Jul 23, 2019
Andre Esteve (@andreesteve) this feature is not currently in any active plan and is just in the backlog. Since the provider currently relies on Win32 APIs and not .NET APIs, it's not a small work item. A PR would be gladly accepted :)
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 23, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.