简体   繁体   中英

Add SSL Certificate to Windows Docker Container

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM