Add support for OpenSSL provider URIs#3456
Add support for OpenSSL provider URIs#3456bdesplanq wants to merge 1 commit intoeclipse-mosquitto:developfrom
Conversation
Add a new keyform option 'uri'. When keyform is set to uri, the OpenSSL store API is used to load the private key. Signed-off-by: Bart Desplanques <bart.desplanques@gmail.com>
Codecov Report❌ Patch coverage is
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
|
I noticed a similar PR was just submitted that does the same: #3488 . This illustrates there is a demand for provider support :-) |
|
Ahhh yes, last time I checked your PR was not there yet, I should have checked again. As you pointed out, I chose to avoid a new key type: store providers creation in openssl aims to remove any key type selection by the application, and only retrieve keys based on the URI or path and available providers, so adding a new type was akin to creating a future needed rework to me (at least that's my understanding, stop me there if I'm wrong). Here I wanted to directly follow openssl way of pulling the keys. It does remove the key existence check though, I'm not sure that's a big issue. As you said, this could be done in a future version, and I'd gladly probe opinions on this, but I do have applications maintenance in mind: introducing a new 'uri' type will create deployment and maintenance tasks for people using it, and fully removing types later on as well. |
|
@amananas I'd be happy with either approach - quite similar in the end. My main interest is to have the provider store loading and uri support built-in in mosquitto since this is indeed the standard way of working for OpenSSL going forward. Then there is no need anymore to maintain this with patches... |
|
Hi both, just to let you know I'm not ignoring this but am letting the dust settle for a while from the 2.1 release before starting to look at new features for 2.2 |
Mosquitto currently does not support OpenSSL 3 provider-based key URIs.
In OpenSSL 3 and later, URIs are used to reference private keys and key stores via the provider and STORE APIs (for example, pkcs11: URIs, but this can be any other URI scheme supported by a given provider). This mechanism replaces the legacy engine-based approach used in earlier OpenSSL versions.
According to the OpenSSL roadmap, engine support is deprecated and scheduled for removal in OpenSSL 4, requiring applications that rely on engines to migrate to provider-based implementations.
This pull request introduces a new keyform option, uri. When keyform is set to uri, Mosquitto uses the OpenSSL STORE API to load private keys via provider URIs, enabling compatibility with OpenSSL 3 providers and future OpenSSL releases.
The change has been validated using either a URI private key reference at client side (e.g. mosquitto_sub) and at broker side.
Thank you for contributing your time to the Mosquitto project!
Before you go any further, please note that we cannot accept contributions if
you haven't signed the Eclipse Contributor Agreement.
If you aren't able to do that, or just don't want to, please describe your bug
fix/feature change in an issue. For simple bug fixes it is can be just as easy
for us to be told about the problem and then go fix it directly.
Then please check the following list of things we ask for in your pull request:
make testwith your changes locally?