m-click / requests_pkcs12

Add PKCS#12 support to the Python requests library in a clean way, without monkey patching or temporary files
ISC License
123 stars 33 forks source link

Cannot Set verify_mode to CERT_NONE when check_hostname is Enabled #47

Closed kamranzafar closed 1 year ago

kamranzafar commented 1 year ago

Latest version doesn't work with verify=False, getting the following error

_Cannot Set verify_mode to CERT_NONE when checkhostname is Enabled

Works fine on version 1.14

vog commented 1 year ago

Good catch! Are you able and willing to provide a pull request to fix this?

yonting commented 1 year ago

I do not know how to make a fix for this. You can change ssl_protocol, so Pkcs12Adapter(..., ssl_protocol=ssl.PROTOCOL_SSLv23), maybe, but ssl.PROTOCOL_SSLv23 is deprecated.

yonting commented 1 year ago

I made a PR with a potential fix.

vog commented 1 year ago

Thanks a lot for your contribution! Although your solution is quite a hack, I don't see any better solution, either. I just released version 1.17 containing your fix:

https://pypi.org/project/requests-pkcs12/