jsonschema icon indicating copy to clipboard operation
jsonschema copied to clipboard

RefResolutionError when using self signed certificate

Open vitofly opened this issue 3 years ago • 1 comments

jsonschema.exceptions.RefResolutionError: HTTPSConnectionPool(host='xxxxx.xxxx.xxxx', port=443): Max retries exceeded with url: /schema.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)')))

https://github.com/python-jsonschema/jsonschema/blob/main/jsonschema/validators.py#L993 Could you please allow users to pass CA_BUNDLE path to verify parameter in requests.get() method? e.g. result = requests.get(uri, verify='/path/to/certfile').json()

vitofly avatar Aug 24 '22 11:08 vitofly

Yes this is definitely reasonable. A future update will likely make the entire HTTP client injectable, so this will definitely come then. In the interim if it helps, I think requests will respect an envvar as well for the CA bundle.

Will leave this open to track, thanks for filing.

Julian avatar Aug 24 '22 12:08 Julian