Closed
Description
I'm writing a new PKCS#11 engine for OpenSSL ( openssl/openssl#8200 ).
Testing with curl I saw that:
curl -E 'pkcs11:object=test' --key 'pkcs11:object=test;pin-value=secret' https://www.saela.eu/auth/index.php
works properly (this is result):
[SSL_CLIENT_VERIFY] = ... self signed certificate
[SSL_CLIENT_SERIAL] = 1EA53B35D50CF1CD1E4A42492518DA318D606A96
[SSL_CLIENT_I_DN] = CN = TEST
[SSL_CLIENT_FINGERPRINT] = 2c0c5a44fa3a9c1e0c5d49fd1a53de75d66c51b0
but with just
curl -E 'pkcs11:object=test; pin-value=secret'
I have
curl: (58) unable to set private key file: 'pkcs11:object=test;pin-value=secret' type PEM
I would like to suggest to insert at https://github.com/curl/curl/blob/master/lib/vtls/openssl.c#L842 these lines:
if (!key_type && do_file_type(cert_type) == SSL_FILETYPE_ENGINE) {
file_type = SSL_FILETYPE_ENGINE;
key_file = cert_file;
}
Best regards,
Antonio
Activity
jay commentedon Mar 20, 2019
Possibly related to #974?
/cc @dwmw2
dwmw2 commentedon Mar 20, 2019
I'd do it like this:
That works here for both PKCS#11 and file certs.
openssl: if cert type is ENG and no key specified, key is ENG too