How can I add a .cer-Certificate inside a Docker container? It has to be done via powershell since the container has no interface to open mms.exe
.
This is a good tutorial for .pfx-Certificates. Since I have a .cer-file without private key, I have to adapt it slightly.
The powershell command from the documentation
Import-Certificate -FilePath C:\myCertificateToAdd.cert -CertStoreLocation Cert:\CurrentUser\Root\
gets stuck whenever called.
In the left pane of the console, double-click Certificates (Local Computer). Right-click Personal, point to All Tasks, and then select Import. On the Welcome to the Certificate Import Wizard page, select Next. On the File to Import page, select Browse, locate your certificate file, and then select Next.
The problem does not appear when importing to the LocalMachine folder:
Import-Certificate -FilePath C:\myCertificateToAdd.cert -CertStoreLocation Cert:\LocalMachine\Root\
Like this, the certificate is importet to every "CurrentUser" on the machine. If this is ok, as for the typical DockerContainer, the problem is solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With