magnuswatn / certsrv

A Python client for the Microsoft AD Certificate Services web page
MIT License
79 stars 26 forks source link

Cannot specify root CA #3

Closed theballdredge closed 7 years ago

theballdredge commented 7 years ago

on nonwindows systems, the library fails to submit requests to a private CA:

urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)>

tried exporting SSL_CERT_FILE, but that appears to only work for requests, not urllib2.

would it be possible to add an optional parameter to specify the CA root?

magnuswatn commented 7 years ago

It works on RHEL/Fedora if you add the cert to the CAs trusted by the system (copy it to /etc/pki/ca-trust/source/anchors/ and "update-ca-trust"). But sure, this should be no problem - I will have a look in a couple of days.

magnuswatn commented 7 years ago

Sorry this took so long. Can you test the version in the cafile-parameter branch and see if it solves your problem? Thanks.

theballdredge commented 7 years ago

looks good save one change i submitted #4 for. working for me otherwise, thanks for the quick response.

magnuswatn commented 7 years ago

Ah, I missed that one - thanks! I wrote some new test cases that catches my error, and merged your change in. If everything looks good to you, I can merge to master and release a new version to PyPi.

theballdredge commented 7 years ago

sure thing. looks right to me.

magnuswatn commented 7 years ago

Sorry this took so long, but version 1.6.1 is now released with support for the cafile parameter. Be aware that it is now a named argument, not a positional argument.