Replies: 23 comments 4 replies
-
Have you tried printing out the error stack from OpenSSL to see if there is any clue? |
Beta Was this translation helpful? Give feedback.
-
Yes, i did. Every step is checked if something's got wrong. But everything is OK, the code runs flawless to the end. It is completely silently ignored. Even openssl in DEBUG mode dont give me a clue. |
Beta Was this translation helpful? Give feedback.
-
This is what I do to load the cert/key from store:
|
Beta Was this translation helpful? Give feedback.
-
And you have exactly 1 cert and 1 key in the token ? |
Beta Was this translation helpful? Give feedback.
-
You may want to try to enable pkcs11-provider's debug log to see if it gives any clue ... |
Beta Was this translation helpful? Give feedback.
-
Yes, I load only the first cert/key - and it's only this pair on the token. And the printout show that its the right one. |
Beta Was this translation helpful? Give feedback.
-
Does the same code work fine if you pass in in a pem file as the uri? |
Beta Was this translation helpful? Give feedback.
-
What I'm trying to do is to migrate from ENGINE to PROVIDER. When I use key and cert PEM files, the code works. |
Beta Was this translation helpful? Give feedback.
-
Do you see the pkcs11 being invoked to make a signature, after the certificate and key have been looked up? |
Beta Was this translation helpful? Give feedback.
-
I'm not sure about that.
shows the cert data
shows the public part of the key
When I disable the default privider in the openssl.cnf I get |
Beta Was this translation helpful? Give feedback.
-
So you get the PIN asked interactively? See https://github.com/latchset/pkcs11-provider/wiki#pkcs11-module-cache-pins |
Beta Was this translation helpful? Give feedback.
-
This was one of my first thougts. This is my openssl.cfg section:
|
Beta Was this translation helpful? Give feedback.
-
what version of opensc is this? |
Beta Was this translation helpful? Give feedback.
-
I'm using an older version of opensc. I can sign and verify succesfully with openssl: |
Beta Was this translation helpful? Give feedback.
-
So, IMO opensc-pkcs11 and libp11kit are working as expected. |
Beta Was this translation helpful? Give feedback.
-
@rmuehl do public and private key, or at least cert and private key have the same CKA_ID ? |
Beta Was this translation helpful? Give feedback.
-
I am trying to see if I can write a minimal reproducer, but I assume I need a TLS server willing to accept client certs? What do you use to test? |
Beta Was this translation helpful? Give feedback.
-
Ok I used the following code:
|
Beta Was this translation helpful? Give feedback.
-
And this command as a server: And I see that the server receives a certificate:
|
Beta Was this translation helpful? Give feedback.
-
Basically I'm doing the same, but using a Yubikey Hardware Token. I compared the provider debug log with opesnssl s_client (which is working). I found, that the digest lines are completely missing:
The only difference at store loading is, that p11prov_store_set_ctx_params() is not being called:
|
Beta Was this translation helpful? Give feedback.
-
On a Yubikey there is no id=....
|
Beta Was this translation helpful? Give feedback.
-
If a key returns no CKA_ID, none is printed. |
Beta Was this translation helpful? Give feedback.
-
I can't find a string "CKA_ID" in the provider debug log. Neither in the working one nor in the not working one. But as the openssl s_client is working with the provider, something must be missing in my SSL_somewhat. |
Beta Was this translation helpful? Give feedback.
-
I'm using openssl-3.0.8 and main branch of the pkcs11_provider.
When i do
openssl s_client -provider pkcs11 -cert "pkcs11:" -connect 127.0.0.1:8443
, I can see the transmitted client certificate on the servers side.Now I'm trying to get this to work in C. I can load key and cert from provider, and both got printed out:
but on SSL_connect()
there's no certificate sent:
40679E910B7F0000:error:0A0000C7:SSL routines:tls_process_client_certificate:peer did not return a certificate:ssl/statem/statem_srvr.c:3511:
I'm completely out if ideas. Maybe someone got this to work?
Beta Was this translation helpful? Give feedback.
All reactions