Skip to content

Regression: When using openssl pkcs11, the crypto engine fails to be found. #17617

Closed

Description

@troth

I did this

mTLS connections are broken when private key is stored in an HSM and accessed via openssl pkcs11 engine:

$ curl --cert /cfg/certmgmt/device-cert-staging.pem --key 'pkcs11:type=private;pin-value=1234;object=TEST_KEYPAIR' --key-type ENG --engine pkcs11 --header 'Content-Type: application/x-www-form-urlencoded' --header 'Content-Type: text/plain' --data '<encoded-data-redacted>' https://example.com
curl: (53) SSL crypto engine not found

I expected the following

With curl version 8.12.1, connecting to a server using mTLS when the private key for a client certificate is stored in an HSM and accessed via openssl pkcs11 engine work fine. Expected it to continue working in 8.14.1 and master.

curl/libcurl version

curl 8.14.1 (aarch64-trimble-linux-gnu) libcurl/8.14.1 OpenSSL/3.5.0 zlib/1.3.1 libidn2/2.3.8 nghttp2/1.65.0
Release-Date: 2025-06-04
Protocols: file ftp ftps http https ipfs ipns
Features: alt-svc AsynchDNS HSTS HTTP2 HTTPS-proxy IDN IPv6 Largefile libz NTLM SSL threadsafe TLS-SRP UnixSockets

Bug was introduced in this commit:

commit f2ce6c46b9dcc46ced0ce43fa95176ea7599a854
Author: Daniel Stenberg <daniel@haxx.se>
Date:   Tue Apr 8 11:45:17 2025 +0200

    openssl: enable builds for *both* engines and providers

    OpenSSL3 can in fact have both enabled at once. Load the provider and
    key/cert appropriately. When loading a provider, the user can now also
    set an associated "property string".

    Work on this was sponsored by Valantic.

    Closes #17165

This fix worked for me:

operating system

Linux bedrock-ttc-wsr-02 6.12.25-v8-16k #1 SMP PREEMPT Wed Apr 30 10:08:58 UTC 2025 aarch64 GNU/Linux

Yocto image built off of master where curl was recently updated from 8.12.1 to 8.14.1.

Activity

  1. troth commented on Jun 13, 2025

    @troth
    ContributorAuthor

    Pull Request: #17618

  2. added a commit that references this issue on Jun 13, 2025
    e55503b
  3. added a commit that references this issue on Jun 15, 2025
  4. added a commit that references this issue on Jun 21, 2025
  5. anatolkavassermann commented on Sep 10, 2025

    @anatolkavassermann

    I ran into this issue today.

    When I specify --engine
    curl --engine <someengine> 'URL'
    I get this error:
    curl: (53) SSL crypto engine not found

    But when executing
    curl --engine list
    curl prints the engine that I want to use.

    But necessary ciphersuites are available when I use
    curl 'URL'

    curl/libcurl version
    curl 8.15.0-DEV (aarch64-unknown-linux-gnu)
    libcurl/8.14.1
    OpenSSL/3.5.1
    zlib/1.3.1
    brotli/1.1.0
    zstd/1.5.7
    libidn2/2.3.8
    libpsl/0.21.2
    libssh2/1.11.1
    nghttp2/1.64.0
    nghttp3/1.8.0
    librtmp/2.3
    OpenLDAP/2.6.10

  6. jay commented on Sep 15, 2025

    @jay
    Member

    I ran into this issue today.

    When I specify --engine curl --engine <someengine> 'URL' I get this error: curl: (53) SSL crypto engine not found

    The fix for this issue is in 8.15.0. Since you are using curl 8.15.0-DEV and not the release you may or may not have the fix. If you can reproduce using the latest curl please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions