Add SSL Certificate to Windows Docker Container

时间:2018-03-25 19:53:30

标签: windows powershell docker ssl-certificate

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.

1 个答案:

答案 0 :(得分:4)

导入LocalMachine文件夹时不会出现此问题:

Import-Certificate -FilePath C:\myCertificateToAdd.cert -CertStoreLocation Cert:\LocalMachine\Root\

就像这样,证书会被导入到每个" CurrentUser"在机器上。如果没问题,就像典型的DockerContainer一样,问题就解决了。