[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL Certs #239

Open
phortonssf opened this issue Jul 27, 2020 · 7 comments
Open

SSL Certs #239

phortonssf opened this issue Jul 27, 2020 · 7 comments

Comments

@phortonssf
Copy link

Deploying to ec2 works great, however the default traefic docker image image doesn't seem to support HTTPS. When loading the traefik dashboard it doesn't show HTTPS and SSL endabled.

From the README.md

Traefik integration, including Let's Encrypt HTTPS certificates automatic generation.

How do we use the included certs for HTTPS? Thank you.

@paxcodes
Copy link
paxcodes commented Aug 1, 2020

One option is to follow the instructions in https://dockerswarm.rocks. Note that the traefik container mentioned here is a separate container from the traefik container included in this cookiecutter.

@phortonssf
Copy link
Author

@paxcodes Ty got it up but ran into a different SSL issue. Most of my calls to the backend are working however one route in particular we added is getting mixed content errors. The headers from uvicorn are returning with http://mydomain.com vs https://mydomain.com. Our other endpoints work perfect. Any ideas on why univicorn is setting them to http on a specific route?

@wolfieorama
Copy link

@paxcodes did you manage to solve this, i run in to the same issue, the issue looks like the certification getting issued is the default one by Traefik,

in my case: CN=TRAEFIK DEFAULT CERT

@paxcodes
Copy link
paxcodes commented Sep 3, 2020

I was able to have SSL for my domains when I followed the instructions in https://dockerswarm.rocks and then the deployment instructions in the README generated by this cookiecutter.

One way to troubleshoot is checking the traefik logs as mentioned here.

If there's a specific step in the process that you're having trouble with, I will try to help.

@paxcodes
Copy link

@paxcodes Ty got it up but ran into a different SSL issue. Most of my calls to the backend are working however one route in particular we added is getting mixed content errors. The headers from uvicorn are returning with http://mydomain.com vs https://mydomain.com. Our other endpoints work perfect. Any ideas on why univicorn is setting them to http on a specific route?

Sorry, no, not off the top of my head. If I were to encounter that, first thing I would check is my docker-compose files: making sure that everything is set up correctly there. Next would be how uvicorn is configured. But this is coming from someone who don't have a lot of experience with ssl certs / docker / uvicorn so I'm covering a lot of ground, instead of targeting something specific.

@wolfieorama
Copy link
wolfieorama commented Sep 17, 2020

I got my issue fixed: after adding the docker.network label and tls on both services it works now

        - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set}
        - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.tls=true
        - traefik.http.routers.${STACK_NAME?Variable not set}-frontend-https.tls.certresolver=le   ```

Also you many need to check if there are any conflicting `http` and `https` redirection rules .. I had that in my `docker-compose` file

@MariusMez
Copy link
MariusMez commented Oct 30, 2020

Hi,

I encounter the same issue than @wolfieorama. All the certificates for the services (pgadmin, flower, and the other required traefik from the dockerswarm.rocks doc) where generated with success using the LetsEncrypt certresolver.

But for the main app wich use the proxy service, it seems traefik didn't success to use letsencrypt and default to the self signed TRAEFIK DEFAULT CERT wich is not good on production...

The logs provided by docker service logs mystack-proxy are not very usefull (level=debug msg="No default certificate, generating one")

By adding the docker.network label and tls on the frontend service it allows traefik to generate the letsencrypt certificate successfully.

But I don't understand why precisely? If someone as a clue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants