Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 729
BaluJr. Avatar asked Mar 25 '18 19:03

BaluJr.


People also ask

How do I import an SSL certificate in Windows?

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.


1 Answers

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.

like image 184
BaluJr. Avatar answered Oct 20 '22 09:10

BaluJr.