简体   繁体   中英

Add self-signed ssl certificate to gcp containerized .net core web vm instance

I have created a web app using .net core, created a docker image, push it to the gcp registry, and deployed to a vm instance. I'm trying to add a self-signed certificate to the web app so I can use https. I added a certificate in the manner where "dontnet dev-certs https" adds one and when I run the docker container locally I can use https, but when I deploy it and use the external IP for the compute engine, the certificate is not valid. I'm at a loss if anyone has any ideas. Thanks.

The issue is that the certificate name (Subject or Subject Alternative Name) does not match the IP address and this causes a certificate verification error.

For self-signed certificates, you can add the IP address to the Subject Alternative Name (SAN).

However, using self-signed certificates will present more problems once you solve the name issue. Configure a DNS resource record mapping the IP address to a domain name and use Let's Encrypt instead - they are free.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM