-
Notifications
You must be signed in to change notification settings - Fork 2
Documentation idea: how to trust *.coder domains in the browser #75
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
Comments
Hey @hugodutka, have you considered mkcert instead of changing local Chrome settings? Generally speaking, one would want to generate and install the mkcert CA locally using Accessing the HTTPS port will result in a genuine HTTPS connection that is independent of the browser and compatible with CURL and other command-line tools. |
I have - setting up custom https certificates is always a headache in my experience. If it's not absolutely necessary, I would rather not do it. Adding the exception in Chrome is much more straightforward. |
@ThomasK33 And to give my thoughts on what we should recommend users do: I think developing with Coder VPN shouldn’t require a different workflow to access your web app than developing locally. If your app is on localhost, you wouldn’t set up an https certificate - it doesn’t provide any benefit. When you develop on a remote machine via VSCode’s Remote SSH, you also don’t set up a cert - you port forward to localhost. The connection is secured by SSH, and it’s fine. With Coder VPN it’s secured with wireguard. So the only problem a user would currently have is that their browser doesn’t know that the http connection to their workspace is in fact secure. The solutions I see are:
I think we should make Coder VPN as easy to use as possible, and I believe 2. is currently the most user-friendly of the bunch. 3. would be the most versatile, but requires using a tool that isn’t that familiar to most developers. I think it’d be a great feature if Coder VPN natively supported the option to port forward to localhost, so users developing on Safari or Firefox can resolve the trust problem too. If it was already available, I wouldn’t have bothered with option 2. |
For future reference, the same can be set in Firefox:
|
Do you have specific experiences with mkcert in that regard?
You do not need a TLS certificate on localhost because the browser considers
That might be the most user-friendly/quickest in a browser context, but not for any other application running on the local device.
While I understand you might have had bad experiences, this statement is an over-exaggeration. I don't see how the steps below for a Coder on Coder workspace are complicated or require a reverse proxy. Initial mkcert setup:
To get a certificate for
To get that cert into the workspace:
To start coder with a TLS certificate:
Now, I can access it in the browser (https://peach-cricket-38.coder:3443/login) without changing settings or having invalid certificates. Same goes for
Sure. Yet, using a local exception instead of an actual TLS certificate introduces a drift between how your application will run and behave when deployed into production with a TLS certificate vs. local development without one. Creating a "proper" secure context for a browser does not introduce any changes compared to a production deployment, and issues will be able to surface while developing locally instead of during production runtime. |
Not anything specific, just vague recollections of some applications not picking up that I trusted a certificate. I haven't used it in a while, it might work well now.
I'm aware of that - maybe my previous comment wasn't clear in that regard. I meant that it'd be fine for the browser to consider *.coder a secure context, since the underlying channel is secure.
Fair. I was mostly considering the web development use case.
Maybe it's just a matter of opinion. I do believe that these steps are complicated, especially for a person that hasn't done it before, and in relation to the alternatives.
That's a benefit of using https for sure. However, I think recommending web developers to set up a development environment that'll more closely match their production environment than what they'd usually do with localhost is out of scope of Coder VPN docs. Ensuring their remote experience matches closely what they'd do locally without Coder is. |
When you do web development, the web server often needs to set some secure cookies in the browser. They are often used for user authorization. Those work on localhost, but not with
http://
, as browsers treat plain HTTP as insecure. For example, by default, you can't log in to Coder when it's hosted withouthttps
.Chromium-based browsers let you manually mark some origins as trusted, and they are then treated as secure. You can do it be setting the following flag: chrome://flags/#unsafely-treat-insecure-origin-as-secure
I did it with my workspace to be able to develop Coder on Coder without
https
and use the development web UI via the .coder domain.It'd be great to document that this is possible when we publish the Coder VPN docs.
Also, It'd be good to mention that this is actually secure with Coder VPN because the connection is still encrypted at a lower part of the networking stack with wireguard.
The text was updated successfully, but these errors were encountered: