Skip to content

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

Closed
@nooobcoder

Description

@nooobcoder

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions