netbox-community / Device-Type-Library-Import

This library is intended to assist with importing device and module types into NetBox from the NetBox Community DeviceType-Library
https://github.com/netbox-community/devicetype-library
MIT License
265 stars 82 forks source link

SSL Certificate issues #54

Closed EnigmaDR closed 2 years ago

EnigmaDR commented 2 years ago

Hi When running this script i get a ssl error: Max retries exceeded with url: /api/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)'))) I have tried setting IGNORE_SSL_ERRORS=True in the .env file, but i still get the same error. i do not get any ssl error when i curl the site

Can you help me fix this?

Thanks

Netbox v3.3.2 with nginx as proxy.

W3AXL commented 2 years ago

Can confirm same issue occurs for me, except I'm using apache as my proxy. I have the IGNORE_SSL_ERRORS flag set to True as well.

requests.exceptions.SSLError: HTTPSConnectionPool(host='***', port=443): Max retries exceeded with url: /api/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))
ndom91 commented 2 years ago

Found this - https://github.com/psf/requests/issues/3829

Can you check that the REQUESTS_CA_BUNDLE env var isn't set in your environments?

Also this will supposedly be fixed in requests>3.0, whenever that is

ndom91 commented 2 years ago

Otherwise, a nice user also provided a little session wrapper class we coudl implement

https://github.com/psf/requests/issues/3829#issuecomment-275603654

Also a similar monkeypatch from stackoverflow: https://stackoverflow.com/a/15445989/9579094

EnigmaDR commented 2 years ago

Hi thanks for your replay, when i set REQUESTS_CA_BUNDLE to the path of my ca cert it work with ssl