-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cURL not working with some specif pkcs11 URLs with GnuTLS backend #16249
Comments
In #14925, I found that curl supports pkcs11 URI if --pass is given. Making libcurl always use gnutls_certificate_set_x509_key_file2 would fix this. |
Hi, @tatsuhiro-t. Are you saying curl with gnutls only supports a pkcs11 url if I'm asking that because I relayed your comment to the person who reported the bug to us, but maybe it wasn't clear to them
I think this would make it behave the same way as using the openssl backend (no need to use |
yes, at least curl behaved like that when I last tested.
The current implementation looks the same as when gnutls_certificate_set_x509_key_file2 was first introduced 10 years ago, back then, it was relatively new, and falling back to gnutls_certificate_set_x509_key_file, which does not support pkcs11 was reasonable. I think we can now make curl always use gnutls_certificate_set_x509_key_file2. |
refs curl#16249 Always use `gnutls_certificate_set_x509_key_file2()` for loading keys and certificates, even without a password, since this function support pkcs11 urls. Thanks to @tatsuhiro-t for finding this out.
I did the change @tatsuhiro-t described in #16472. Thanks for finding this! @charles2910, hope this helps. |
Note that I could not make softhsm2 and p11tool remove PIN. I also found that the error message "curl: (3) URL rejected: Port number was not a decimal number between 0" is quite suspicious. It is most likely the user failed to specify --cert and URL correctly. |
My thinking as well. It smells like a wrong command line somehow. |
Hi, this is the only known pending bug from our switch from openssl to gnutls backend on Debian. We've mentioned it to Daniel at FOSDEM and I'm forwarding to you guys because I lack the hardware (HSM) and the knowledge to dig deeper here - and we're also near the Debian freeze for the next stable release, but we should be able to upload new version up until may.
The original report is:
After some back and forth with the reporter and you on the issue tracker, some new info come by:
And the easy reproducer:
I've checked the pkcs11 RFC and indeed it seems to be a valid pkcs11 URL.
It would be really nice if we could sort this one out. I'll tag also the other cURL maintainers (@samueloph and @sergiodj)
I expected the following
Using the HSM for pkcs11
curl/libcurl version
curl 8.8.0, 8.9.1
operating system
Debian
The text was updated successfully, but these errors were encountered: