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
124 stars 33 forks source link

requests-pkcs12=1.3 can't have pkcs12_password='' #10

Closed fenchu closed 5 years ago

fenchu commented 5 years ago

Hi This worked fine in v1.2:

with Session() as s:
    s.mount(args.url, Pkcs12Adapter(pkcs12_filename='Profil.NET.Api.ResponseCenter.Client.p12', pkcs12_password=''))

But in v1.3:

Traceback (most recent call last):
  File ".\connect.py", line 41, in <module>
    s.mount(args.url, Pkcs12Adapter(pkcs12_filename='Profil.NET.Api.ResponseCenter.Client.p12', pkcs12_password=''))
  File "D:\dev\flask\lib\site-packages\requests_pkcs12.py", line 71, in __init__
    raise ValueError('Insufficient data to create SSL Context')
ValueError: Insufficient data to create SSL Context

my *.p12 cert does not have a password. which is a fully allowed config.

vog commented 5 years ago

Thanks for the bug report!

I'm very sorry for this regression. This issue has been introduced by commit 029e31df78f9d2c8356d50300ac078e7db1d16a3 as provided in pull request #9. I should have reviewed this more carefully.

Please retry with version 1.4, where I removed the nonsense check which caused your issue.

vog commented 5 years ago

@fenchu Does the latest version (meanwhile 1.6) work for you?

fenchu commented 5 years ago

Thanks vog. I can confirm v1.6 works excellent