-
Notifications
You must be signed in to change notification settings - Fork 896
feat!: generate a self-signed certificate if no certificates are specified #5973
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
Conversation
…fied Clouds like AWS automatically navigate to https://<ip-here>. This allows us to bind to that immediately, serve a self-signed certificate, then reroute to the access URL.
@deansheather Ben needs this to proceed with his work, so I'm going to merge this ASAP and do a release. If you see any issues, just let me know! |
@kylecarbs what about if we do not use tls and use coder behind a reverse proxy like caddy? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems OK but this is a breaking change as we no longer redirect by default. You can mark your PR as breaking by adding !
before the :
and adding the release/breaking label.
cli/server.go
Outdated
var selfSignedCertificate *tls.Certificate | ||
if len(certs) == 0 { | ||
selfSignedCertificate, err = generateSelfSignedCertificate() | ||
if err != nil { | ||
return nil, xerrors.Errorf("generate self signed certificate: %w", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just certs = append(certs, selfSignedCertificate)
instead of the extra logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Will fix!
Clouds like AWS automatically navigate to https://. This allows us to bind to that immediately, serve a self-signed certificate, then reroute to the access URL.
@deansheather I'm going to change the
tls-redirect-http-to-https
flag toredirect-to-access-url
instead.Edit: to automatically listen on 443 then redirect to the access URL:
This will still open the tunnel (because
access-url
is not set), prompt for a self-signed certificate, then redirect the user to our external tunnel.