Replies: 1 comment 1 reply
-
I was having this error on Ubuntu 22.04, I tried installing the CA from the container to my host machine, but that didn't help. I found I had a couple of issues. 1: libnss3 tools wasn't installed which threw an error during his scripts Installed and tried a clean install (pruned all the containers and volumes from this). Still didn't work. 2: My machine didn't like his CA? I tried a few approaches and finally thought: "Why not install mkcert on my host machine, generate everything there, then copy the certs over to the container?" This is a "compiled" list of steps I took that did or seemed to help. # Install libnss3-tools
sudo apt update
sudo apt install libnss3-tools
# Install mkcert binaries for Ubuntu/Debian (directions from its Github repo (https://github.com/FiloSottile/mkcert)
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
chmod +x mkcert-v*-linux-amd64
sudo mv mkcert-v*-linux-amd64 /usr/local/bin/mkcert
# Install your root CA and generate key and cert
mkcert -install
mkcert -key-file nginx.key -cert-file nginx.crt magento.test
# Copy the key and cert file over to your container
docker cp "./nginx.crt" "$(docker-compose ps -q app|awk '{print $1}')":/var/www/html
docker cp "./nginx.key" "$(docker-compose ps -q app|awk '{print $1}')":/var/www/html
# Set ownership and move them to the proper place in your container
docker-compose exec -T -u root app chown app:app nginx.key nginx.crt
docker-compose exec -T -u root app mv nginx.key nginx.crt /etc/nginx/certs/
# Restart your Magento environment
bin/stop
bin/start After this Firefox and Chrome displayed I haven't play-tested this on another Ubuntu 22.04 system, but I have one that's "clean"(ish) and might later. Tagging @markshust in case it helps Also, if you want to log into your app container as root so you can edit conf files directly in folders outside /var/www/html (not recommended, but useful sometimes)
|
Beta Was this translation helpful? Give feedback.
-
I have set up docker-magento on Ubuntu but having problems with the SSL certificate as it is not trusted. I run the commands to generate the SSL CA certificate and set up the certificate (both with sudo) but cannot manage to get the green icon in Chrome. Has anybody had the same issue?
Beta Was this translation helpful? Give feedback.
All reactions