Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Localhost HTTPS and domains #81

Closed
zimbatm opened this issue Feb 5, 2021 · 0 comments
Closed

Localhost HTTPS and domains #81

zimbatm opened this issue Feb 5, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@zimbatm
Copy link
Member

zimbatm commented Feb 5, 2021

Related to #74 and #75 .

This is not directly a responsibility of devshell but is related to making a comfortable development environment.

Oftentimes, developers want to be able to test one or more services locally, with HTTPS enabled, in order to replicate the production environment as much as possible. This ticket contains some notes on what I think is the ideal setup.

Localhost HTTPS interface

We need the cooperation of the host on two fronts:

  • dynamic hostnames that point to localhost
  • TLS certificate acquisition

*.test TLD for localhost

The .test TLD is reserved and is therefore guaranteed to never be clashing with external domains. https://en.wikipedia.org/wiki/.test

The developer can either edit their /etc/hosts, or have a local DNS resolver that maps all the *.test domains to localhost.

Open question: how to handle port-mapping so that multiple services can bind? On Linux, 127.X.X.X is all reserved for localhost so each service could technically get their own IPs. Maybe we can use a dictionary to IP mapping or something like that.

Let's encrypt for localhost

Ideally, a localhost service is running that talks ACME protocol.

The CA public certificate would be installed in the computer's trust cert.

The CA private certificate is installed in the ACME service and used to issue new certificates.

The services themselves would query the ACME protocol to acquire new certs and use http01 for validation.

Ideally, the CA can be pinned to it can only issue certs for the .test top-level. That way if the private certificate gets leaked, the impact would still be limited.

@zimbatm zimbatm added the enhancement New feature or request label Feb 5, 2021
@zimbatm zimbatm closed this as completed Feb 14, 2021
@numtide numtide locked and limited conversation to collaborators Feb 14, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant