enable https on multiple domain or ip #6691
Unanswered
Not-a-good-username
asked this question in
Q&A
Replies: 1 comment 1 reply
-
There is nothing code-server can do about this, but assuming you have no choice but to access via the IP you could add it as an exception to your browser. For example in Chrome there is chrome://flags/#unsafely-treat-insecure-origin-as-secure |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I've been using code-server for a while, and it perfectly meets my needs. However, there is a slight issue (perhaps it's my own problem). I hope everyone can provide some suggestions and help for my needs. Thank you all.
I deployed code-server on my local NAS within the intranet, using port 8824, with the intranet IP being 192.168.3.31, and it's also accessible via Ubuntu.local. Then, I set up SSH reverse proxy to forward this port to a specified port on my cloud server (let's assume it's 111.22.33.44:12345). Additionally, I have my own domain and an HTTPS wildcard certificate (let's assume it's *.lyc.work), and I've resolved this domain to the corresponding port using Nginx. I configured code-server's certificate locally using the *.lyc.work certificate and key. Now, I can perfectly access code-server on my NAS remotely via this domain. However, when I try to access it within the local network using the intranet IP, local domain, or directly with the public IP + port, it prompts an error as follows:
Failed to load Web view: Error: Could not register service worker: SecurityError: Failed to register a ServiceWorker for scope ('https://111.22.33.44:12345/stable-**********/static/out/vs/workbench/contrib/webview/browser/pre/') with script ('https://111.22.33.44:12345/stable-**********/static/out/vs/workbench/contrib/webview/browser/pre/service-worker.js?v=4&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&remoteAuthority=111.22.33.44:12345'): An SSL certificate error occurred when fetching the script..
I understand that this problem arises because the certificate and domain do not match. However, I hope there is a solution because I may often need to use markdown preview. Is there any way to prevent this error when the certificate domain does not match? Or is there a way for code-server to use multiple certificates?
Anyway, thank you all in advance! I hope code-server continues to improve.
Beta Was this translation helpful? Give feedback.
All reactions