jawah / niquests

“Safest, Fastest, Easiest, and Most advanced” Python HTTP Client. Production Ready! Drop-in replacement for Requests. HTTP/1.1, HTTP/2, and HTTP/3 supported.
https://niquests.readthedocs.io/en/latest/
Apache License 2.0
811 stars 19 forks source link

HSM/pkcs11 support #102

Closed gillespilloudkerlink closed 6 months ago

gillespilloudkerlink commented 6 months ago

With growing need of security from the application, the support of secured-stored certificate becomes essential.

It would be great to have the support of PKCS#11 ssl engine with the capacity to read the certificate at the pkcs11 format client_key = 'pkcs11:token=testtoken;object=mykey;pin-value=12341234'

Opened questions regarding this need in www : https://stackoverflow.com/questions/57976489/hsm-integration-with-python-requests-module pycurl support this feature.

Ousret commented 6 months ago

I understand the usefulness of having a shortcut to PKCS11-type certificates. Right away, I don't think I can add HSM access in Niquests due to my actual maintenance burden for now.

In the meantime, you could directly use a dedicated library capable of providing the cert and key from that device and once you have them, put them into cert=(pub, priv) keyword argument.

For a side note, it is planned to support loading p12 file automatically soon.

Regards,