pyopenproject icon indicating copy to clipboard operation
pyopenproject copied to clipboard

Api Connection with HTTPS URL

Open andreamelone opened this issue 3 years ago • 3 comments

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)')))

andreamelone avatar Aug 07 '22 20:08 andreamelone

Hi, I have a problem about SSL Certificate. I try many solution but the response it is the same ... Help me plase Thanks

andreamelone avatar Aug 16 '22 09:08 andreamelone

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

fduraibi avatar Feb 27 '23 09:02 fduraibi

There are also two more files in the same folder "post" and "patch" where you need to bypass the validation in the same way

fduraibi avatar Feb 27 '23 11:02 fduraibi