Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

WebViews do not load with https and self signed certificates #3754

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

Closed
nooobcoder opened this issue Jul 9, 2021 · 1 comment
Closed

WebViews do not load with https and self signed certificates #3754

nooobcoder opened this issue Jul 9, 2021 · 1 comment

Comments

@nooobcoder
Copy link

nooobcoder commented Jul 9, 2021

I use dockerized code-server and this is my docker run command I use every time to spin a container.

This error is also mentioned in #3410 but my problem is a bit different I guess. Please help me @jsjoeio @code-asher @oxy with this.

docker run -it --name code-server --network host -v "${PWD}/.config:/home/coder/.config" -v "${PWD}/data:/home/coder/.local/share/code-server"   -v "/home/ubuntu/VSCodes:/home/coder/project" -v "${PWD}/certs/certs.crt:/home/coder/cert.crt" -v "${PWD}/certs/certs.key:/home/coder/cert.key"  -u "$(id -u):$(id -g)"  -e "USER=$USER"  codercom/code-server:latest --cert /home/coder/certs.crt --cert-key /home/coder/certs.key

Everything works as it should but the webviews do not work at all in Chrome. I did open code-server web ui on Firefox and the webviews do load but in Chrome i have no luck. Why is this so.
For the time being also, Firefox is not the solution, because firefox do not have clipboard access facility to paste text from clipboard into the code-server integrated terminal. I am sharing relevant screenshots to have a better picture of this thing.

Just for your information, I am using the latest Chrome Beta to use code-server.
Chrome Version Screenshot

This might be a self signed certificate thing i guess, and this is the command that i used to generate a Self Signed cert to use code-server in LAN

openssl req \
       -newkey rsa:2048 -nodes -keyout certs.key \
       -x509 -days 365 -out certs.crt

Error on Chrome

Screenshot 1

Screenshot 2

Screenshots from Firefox

Just observe that the service worker is registered which was not in Chrome and the WebViews load successfully.

Screenshot 3

Screenshot 4

Before you ask for code-server logs, I am mentioning them below, seems like pretty clean to me at least showing no errors
image

and this is my config.yaml file that I use to serve code-server

bind-addr: 0.0.0.0:8080
auth: password
password: mysupersecretpassword
cert: true
@nooobcoder
Copy link
Author

nooobcoder commented Jul 9, 2021

My suggestion: Please let the serviceworker work without a proper cert if possible.
Also a thing to mention, I cannot install code-server as a PWA on my laptop due to this cert error for sure. Earlier I used it, many months back and since then I did not ever got the option to install the PWA of code-server.

DO I need to use some reverse-proxy complicated stuffs for this, please help me out, and I have no knowledge about reverse proxies 😔, if someone has a guide for this, would be helpful too.

@jsjoeio jsjoeio closed this as completed Jul 9, 2021
@coder coder locked and limited conversation to collaborators Jul 9, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants