I want to build the Matter ChipTool App as an apk for Android on WSL2 on my company laptop. The general Repository for this is https://github.com/project-chip/connectedhomeip. I followed the instruction here https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/android_building.md to build the App, but I get this error when I run source scripts/bootstrap.sh
:
Downloading and installing packages into local source directory:
Setting up CIPD package manager...[|]
Bootstrap: SSL error in Python when downloading CIPD client.
If using system Python try
sudo pip install certifi
And if on the system Python on a Mac try
/Applications/Python 3.6/Install Certificates.command
If using Homebrew Python try
brew install openssl
brew uninstall python
brew install python
If those don't work, address all the potential issues shown
by the following command.
brew doctor
Otherwise, check that your machine's Python can use SSL, testing with the httplib module on Python 2 or http.client on Python 3.
Traceback (most recent call last):
File "/home/florianw/dev/git/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 857, in <module>
sys.exit(main())
File "/home/florianw/dev/git/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 849, in main
return EnvSetup(**vars(parse())).setup()
File "/home/florianw/dev/git/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 501, in setup
result = step(spin)
File "/home/florianw/dev/git/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 595, in cipd
cipd_client = cipd_wrapper.init(
File "/home/florianw/dev/git/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/wrapper.py", line 378, in init
bootstrap(client, silent, rosetta=rosetta)
File "/home/florianw/dev/git/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/wrapper.py", line 328, in bootstrap
tmp.write(client_bytes(rosetta))
File "/home/florianw/dev/git/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/wrapper.py", line 252, in client_bytes
conn.request('GET', path)
File "/usr/lib/python3.8/http/client.py", line 1256, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1302, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output
self.send(msg)
File "/usr/lib/python3.8/http/client.py", line 951, in send
self.connect()
File "/usr/lib/python3.8/http/client.py", line 1425, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1131)
I already checked if I installed python3 (it is version 3.8.10) and also installed openssl like it said but I still get the same error.Also i extecuted sudo pip install certifi
and it installed it successfully, but I still get the same error.
CodePudding user response:
I finally found the problem. I needed to add the root certificate for my company into WSL with:
$ sudo apt-get install -y ca-certificates
$ sudo cp local-ca.crt /usr/local/share/ca-certificates
$ sudo update-ca-certificates