Api Connection with HTTPS URL
HTTPSConnectionPool(host='openproject.sagecloud.it', port=443): Max retries exceeded with url: /api/v3/users (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:997)')))
Hi, I have a problem about SSL Certificate. I try many solution but the response it is the same ... Help me plase Thanks
HTTPSConnectionPool(host='openproject.sagecloud.it', port=443): Max retries exceeded with url: /api/v3/users (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:997)')))
This error is showing because you are using a self signed certificate.
The correct solution is to trust your certificate (search the web and you will find the solution that fits your operating system)
Another solution, which is NOT RECOMMENDED for production use, is to bypass the ssl check, and you need to do it in two locations in this code: 1- for GET requests:
https://github.com/Flying-Free/pyopenproject/blob/e568d804af3c40f17f1fad6f17c9e4e1d4fd944c/pyopenproject/api_connection/requests/get_request.py#L16
Add to the get "verify=False", so it will become:
response = s.get(self.connection.url_base + self.context, verify=False)
2- for PUT requests:
Add "verify=False" similar to the GET requests but in this file: https://github.com/Flying-Free/pyopenproject/blob/e568d804af3c40f17f1fad6f17c9e4e1d4fd944c/pyopenproject/api_connection/requests/put_request.py#L12-L17
There are also two more files in the same folder "post" and "patch" where you need to bypass the validation in the same way