5008: [4.1][SSL: CERTIFICATE_VERIFY_FAILED] Certificate verification failure - self-signed certificate problem

MRosiek

What version are you running?

I'm using RBTools 4.1 in poetry virtual env
Python 3.9.7

ReviewBoard server info:
Review Board/rb-site 5.0.5
Python 3.8.10 (default, May 26 2023, 14:05:08)

What steps will reproduce the problem?

  1. Have ReviewBoard hosted on the server which have self-signed certificate by company internal certificate authority.
  2. Create python virtual env
  3. Install latest rbtools version (4.1) either via pip or poetry
  4. Issue command: rbt status -d

What is the expected output? What do you see instead?

Current status should be shown.
SSL certificate error occurs.

What operating system are you using?

Windows 10

Attach the debug out from the command.

$ rbt status -d
>>> RBTools 4.1
>>> Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)]
>>> Running on Windows-10-10.0.19044-SP0
>>> Home = C:\Users\my_user\AppData\Roaming
>>> Current directory = C:\Projects\test\git_folder\my_package
>>> Command line: rbt status -d
>>> Making HTTP GET request to https://company_internal_reviewboard_url/api/
Traceback (most recent call last):
  File "C:\Projects\test\git_folder\my_package\.venv\lib\site-packages\rbtools\api\request.py", line 367, in connect
    return super().connect(*args, **kwargs)
  File "C:\Program Files\Python39\lib\http\client.py", line 1448, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "C:\Program Files\Python39\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Program Files\Python39\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Program Files\Python39\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

Please provide any additional information below.

In company with have our own certified authority which issues certificates for various services.

RBTools configuration file:

REVIEWBOARD_URL = 'https://company_internal_reviewboard_url/'
REPOSITORY = 'my_repository'
REPOSITORY_TYPE = "git"
TRACKING_BRANCH = "origin/master"

Temporary solution.

Uninstall rbtools and reinstall it with version 4.0. With version 4.0 all works fine.

Notice: when you have already installed rbtools with version 4.0 and upgrade it to 4.1 it still works fine, but when you are doing fresh installation it wont work.