Skip to content

Is it possible to use SSL on localhost? #56

Open

Description

@Aquive

Is it possible to use SSL on localhost? I found this guide: https://letsencrypt.org/docs/certificates-for-localhost/ Which generates the keys. Is it possible to use those, and how?

Thanks!

Activity

  1. vdloo commented on Nov 10, 2021

    @vdloo
    Member

    @Aquive I don't really have a ready to go answer for that. I'd go with a self signed certificate in the container if I had to set up something like that. You could configure SSL in the NGINX inside the hypernode-docker just like you could with any other NGINX installation, but for letsencrypt validation of course is the issue (the normal acme challenge of course can't reach your local container). And whether or not letsencrypt allows you to create a certificate for localhost I don't exactly know.

    I'd:

    • figure out how to generate a self signed ssl certificate (something like this)
    • edit the nginx config inside the container to use that
    • if it's just for local testing, ignore the browser warning about your self signed certificate
  2. frosit commented on Nov 24, 2021

    @frosit
    Contributor

    Why would you need SSL on localhost? There should be no restrictions due to SSL because it's localhost.

    I use let's encrypt with the dehydrated command to generate certificates for my docker/WSL environment. If you point a subdomain to localhost or your LAN IP (containing docker), you can use let's encrypt with DNS verification instead of http verification to generate them. This allows me to have a an actual certificate on my instance while browsing my site from other devices within my LAN. Doesn't require you to mess with nginx or setting up self signed certificates at all.

    I use a dehydrated hook script for this, if this is what you're looking for i can put it in a gist. Some like: dehydrated -c --hook dnshook.sh --challenge dns-01

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions