简体   繁体   中英

How to connect my docker with SSL in local network (without domain)?

I wanted to know if there was a way to secure the traffic between my Rapsberry Pi, which runs Docker, and my computer on the same local network with SSL protocol. I just want to be able to connect HTTPS to my containers, just in local with let's encrypt (I use raspberrypi.local domain).

Thanks,

You can use SSL to connect to a local (not registered) domain, but not using letsencrypt.

Letsencrypt (and any other service that provides certificates) needs to verify the ownership of the domain in order to deploy a certificate. This is done in various ways (out of the scope of this question) but in any case, an existing domain name, publicly resolvable, must exist. This is not your case obviously.

What you can do, is generate a self-signed certificate and use that to connect through SSL.

This is a tutorial for generating an SSL certificate using docker only: https://codefresh.io/blog/using-docker-generate-ssl-certificates/

Once you have a certificate, you have to deploy it in your docker app stack, but I guess this is off-topic for your question.

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