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.
答案 0 :(得分:4)
导入LocalMachine文件夹时不会出现此问题:
Import-Certificate -FilePath C:\myCertificateToAdd.cert -CertStoreLocation Cert:\LocalMachine\Root\
就像这样,证书会被导入到每个" CurrentUser"在机器上。如果没问题,就像典型的DockerContainer一样,问题就解决了。