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

New local dev domain + valid HTTPS cert #498

Closed
lmakarov opened this issue Apr 5, 2018 · 7 comments
Closed

New local dev domain + valid HTTPS cert #498

lmakarov opened this issue Apr 5, 2018 · 7 comments
Assignees

Comments

@lmakarov
Copy link
Member

lmakarov commented Apr 5, 2018

Add support for *.x.docksal.io with a valid cert from LetsEncrypt.

image

This will be optional and in addition to the default *.docksal domain.

This requires changes to docksal-vhost-proxy and docksal-dns services.

Related: #1215

@lmakarov lmakarov self-assigned this Apr 5, 2018
@achekulaev achekulaev added this to To do in Docksal 1.9.0 Apr 6, 2018
@frederickjh
Copy link
Contributor

If it is also possible can we structure the code so that if DOCKSAL_DNS_DOMAIN is set it is also possible to create a LetsEncrypt certificate. My use case for this is, I use Docksal on a development server that uses a domain name that is publicly accessible to allow clients to preview sites.

@lmakarov
Copy link
Member Author

lmakarov commented May 3, 2018

@frederickjh are you asking for a fully automated integration with LetsEncrypt? E.g. just set DOCKSAL_DNS_DOMAIN and have Docksal automatically request certs from LetEncrypt and configure everything?

Something like that would be a killer feature, indeed. However, it will also require a substantial amount of work. For wildcard domains/certs that may not even be possible to fully automate, since LetsEncrypt requires DNS level verification to issue those.

What will be possible - is do the cert request manually and then have docksal-vhost-proxy use it. LetsEncrypt certs are valid for 90 days. After that you'll have to go through the same process again.

@frederickjh
Copy link
Contributor

The manual renewal is OK for me.
Cpanel and Webmin have ways that you can have LetsEncrypt certificates renewed on a timed basis say every 60 days. They also email when they renew or fail to do so.

achekulaev referenced this issue in docksal/addons May 17, 2018
@lmakarov lmakarov removed this from To do in Docksal 1.9.0 May 31, 2018
@lmakarov lmakarov added this to To do in Docksal 1.10.0 via automation May 31, 2018
@achekulaev achekulaev removed this from To do in Docksal 1.10.0 Jun 26, 2018
@achekulaev achekulaev added this to To do in Docksal 1.11.0 via automation Jun 26, 2018
@lmakarov lmakarov added this to To do in Docksal 1.12.0 via automation Oct 31, 2018
@lmakarov lmakarov removed this from To do in Docksal 1.11.0 Oct 31, 2018
@lmakarov
Copy link
Member Author

lmakarov commented Nov 26, 2018

Apparently, the idea of shipping a cert with the app, which points to a local/internal IP is not new.
Also, apparently, this is considered bad and the certificate authority is supposed to revoke such certs.

https://letsencrypt.org/docs/certificates-for-localhost/

This is considered a compromise of your private key, and your Certificate Authority (CA) is required to revoke your certificate if they become aware of it. Many native apps have had their certificates revoked for shipping their private key.

From https://groups.google.com/d/msg/mozilla.dev.security.policy/pk039T_wPrI/nl6jDeEFCgAJ

These certs started being used because Chrome would not allow WSS
connections on non-https.

Long discussion on Reddit on Blizard installing a self-signed cert as trusted on user mahcines:
https://www.reddit.com/r/heroesofthestorm/comments/7lb8vq/hey_blizzard_whats_the_deal_with_this_sneaky_root/
This looks to be the only "valid" approach to getting a "valid" trusted certificate for a local domain.

An here's an total overkill option (for local development needs) from Cloudflare: Keyless SSL: The Nitty Gritty Technical Details

@lmakarov
Copy link
Member Author

Adding trusted certs from command line:

  • macOS

      sudo security add-trusted-cert -d -r trustRoot -k "/Library/Keychains/System.keychain" "/private/tmp/certs/certname.cer"
    
  • Linux

      sudo mkdir /usr/local/share/ca-certificates/extra
      sudo cp root.cert.pem /usr/local/share/ca-certificates/extra/root.cert.crt
      sudo update-ca-certificates
    

    Extra treatment may be necessary for browsers, as described in the post.

  • Windows

      certutil -enterprise -f -v -AddStore "Root" <Cert File path>
    

@lmakarov lmakarov changed the title New local dev domain: x.docksal.io New local dev domain + valid HTTPS cert Nov 26, 2018
@lmakarov lmakarov removed this from To do in Docksal 1.12.0 Jan 4, 2019
@wizonesolutions
Copy link

ddev uses mkcert to accomplish this. Then they generate certificates for containers when starting them. Perhaps Docksal could go a similar route.

@lmakarov
Copy link
Member Author

lmakarov commented Jul 6, 2020

Closing in favor of:

@lmakarov lmakarov closed this as completed Jul 6, 2020
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

4 participants