4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

wsl で ssl エラーになる

Posted at

現象

wsl 側で ssl 通信しようとすると、「Please install missing certificates.」となって通信に失敗します。

...
Connecting to update.code.visualstudio.com (update.code.visualstudio.com)|20.43.132.130|:443... connected.
ERROR: cannot verify update.code.visualstudio.com's certificate, ...:
  Self-signed certificate encountered.
To connect to update.code.visualstudio.com insecurely, use `--no-check-certificate'.
ERROR: Failed to download https://update.code.visualstudio.com/commit:507ce72a4466fbb27b715c3722558bb15afa9f48/server-linux-x64/stable to /home/ubuntu/.vscode-server/bin/507ce72a4466fbb27b715c3722558bb15afa9f48-1631168155.tar.gz
Please install missing certificates.
Debian/Ubuntu:  sudo apt-get install ca-certificates

解決策

windows システム側にある CA cert ファイル(筆者環境ではxxx.pem)を wsl 側の/usr/local/share/ca-certificates/ ディレクトリに保存。拡張子が pemのものはcrtに変更。その後、update-ca-certificatesを実行することで、wsl 側に証明書を配置でき、ssl エラーが出なくなりました。

$ sudo update-ca-certificates
Updating certificates in /etc/ssl/certs...
2 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?