I created a Self-signed certificate (with IP address - SAN) for Docker Private Registry and successfully access https://[IPADDRESS]/v2/_catalog but can't access it over the HTTP connection. It says ERR_INVALID_HTTP_RESPONSE and docker logs show :
http: TLS handshake error from 192.168.1.7:58316: tls: first record does not look like a TLS handshake
I follow this instructions for self-signed IP certificate: https://nodeployfriday.com/posts/self-signed-cert/ :
[req]
default_bits = 4096
default_md = sha256
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
C = US
ST = VA
L = SomeCity
O = MyCompany
OU = MyDivision
CN = 192.168.13.10
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
IP.1 = 192.168.1.7
I saved a conf file and run generate command:
openssl req -new -nodes -x509 -days 365 -keyout domain.key -out domain.crt -config <path/to/req/file/from/above>
then created domain.crt and domain.key, then started container:
docker run -d -p 5000:5000 --restart=always --name registry \
-v /home/dataserver/certs:/certs \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \
-e REGISTRY_HTTP_TLS_KEY=/certs/domain.key registry
How can I access it over HTTP? The registry only work with HTTPS :/ Thanks now