-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[Bug]: Webview error #5338
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
Maybe related to #4800 |
@gogobd Almost certainly there is something wrong with your certificates and/or setup. @jsjoeio This is not a |
I am starting code-server with |
|
$ code-server --help
[...]
--cert Path to certificate. A self signed certificate is generated if none is provided.
[...] ℹ️ When using self-signed certificates, its root CA needs to be added to the (Systems/Braves?) trust store. I don't think Brave – as a privacy-focused browser – does support self-signed certificates [by default]. |
This error has nothing to do but with your certificate and the protocol(http/https) you use. Webview is based on Service Work and Service Work needs https to run |
Thanks everyone very much for your help! I installed mkcert on my host machine, with brew; after installing the root certs a second time i got:
But i still get
I don't want to start my browser with these options because all other sites I use work fine and I thought there must be a way to get this to work properly... Brave is Chrome / Chromium based and they are listed under https://github.com/FiloSottile/mkcert#supported-root-stores as supported. |
@gogobd Did you include the certificate generated by |
No, i want code server to generate its own certificates on startup. |
Then the root CA from |
If you want to use the certificate generated by code-server, you must add the root CA from the Dockerfile to your trust store. |
Agree, I think we need to generate a cert from mkcert which can be verified by your local CA. Then you use that existing cert by passing params to code-server like |
So whenever someone uses the --cert option to let code server generate certificates on startup it actually breaks a lot of features? This doesn't make much sense to me at the moment... |
Could I retrieve the generated root certificates from my container and include them in my hosts trust store? |
No. This seems to be a limitation of Brave with self-signed certificates. |
I do not know. It's better to use QED |
I upgraded to 4.9.0 and this issue is still not solved; the certificate that is being generated on startup doesn't work in Brave. |
@gogobd are you using Ubuntu 22.04 by chance? |
I found a way to get Brave to work on MacOS. I am cross-posting this (see #4800). |
@gogobd Please close the issue when it is resolved. |
Note: |
The solution worked for me, but you have to generate a certificate with subjectAltName (and your served dns), like this : |
Is there an existing issue for this?
OS/Web Information
code-server --version
:/root/.local/lib/code-server-4.5.0/lib/vscode/bin/remote-cli/code-server: 12: /root/.local/lib/code-server-4.5.0/lib/vscode/node: not found
Steps to Reproduce
Expected
Code server should run with all features enabled
Actual
All sorts of random problems, including broken Image display
Logs
Error loading webview: Error: Could not register service workers: SecurityError: Failed to register a ServiceWorker for scope ('https://localhost:8080/stable-30d9c6cd9483b2cc586687151bcbcd635f373630/static/out/vs/workbench/contrib/webview/browser/pre/') with script ('https://localhost:8080/stable-30d9c6cd9483b2cc586687151bcbcd635f373630/static/out/vs/workbench/contrib/webview/browser/pre/service-worker.js?v=4&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&remoteAuthority=localhost:8080'): An SSL certificate error occurred when fetching the script..
Screenshot/Video
No response
Does this issue happen in VS Code or GitHub Codespaces?
Are you accessing code-server over HTTPS?
Notes
"This certificate is not trusted, expires ..." and it says the time of installation
The text was updated successfully, but these errors were encountered: