-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Configurable loading of OpenSSL providers #12369
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
Comments
I second this. I just had a major headache after updating to Debian 12 Bookworm because of this. OpenSSL and the PHP libraries that were trying to use it just refused to open the .p12 file until I enabled legacy providers in OpenSSL config. |
I don't think we would want to enable legacy provider by default as it contains insecure algorithms but maybe something that would allow easier loading of providers could be added. |
User Contributed Notes report the openssl-pkcs12-read doesn't work anymore https://www.php.net/manual/en/function.openssl-pkcs12-read.php |
Maybe it could be applied just for the For affected users, the current workaround is awful as it requires to add or uncomment certain openssl.cnf lines from specific sections to look like this:
Configuration placement differs depending on the platform or there could be multipe configuration files, the openssl.cnf that uses the openssl command corresponds to the OPENSSLDIR value that returns the Modifying the whole OpenSSL configuration is worse than having fine grained legacy provider loading when required by affected PHP funtions, so this is good to have as an opt-in configuration at least. |
So I have been looking into this and investigated the whole providers loading. As correctly noted the only way how to load providers is through the config. Specifically it needs to load the config and call There is actually a way how you can change OpenSSL config so it does not need to depend on
Please note that it needs to be set before MINIT so if you run it in FPM, then it needs to be exported when starting FPM. Adding that to FPM config is not going to work because that would be just for children that run after MINIT. I realise that it is not an optimal solution and we should allow configurable way of loading and activating providers. This will be however a feature so it can only target master branch which currently means PHP 8.4. I have been also checking how we could enabled specific providers only for specific PHP part (e.g. enabling it legacy just pcks12 functions). There is a library context ( |
@fdelapena hi, on windows, i'm already tried
But Still |
@parallels999 not tested on Windows here, but it could be #9890. |
Yes, that was it, I added |
Thanks, I updated the openssl.cnf |
and it works. Thanks |
This is a perfect solution |
Description
Since OpenSSL 3, some ciphers are not available unless users configure some openssl.cnf file. This is not always possible on certain hosting configurations, so allowing this would unbreak applications depending on this feature.
Today, Windows .p12 files are still being generated using legacy ciphers, so PHP applications relying on this feature are not working out of the box. Distros are dropping OpenSSL 1.x.x since upstream support ended, current apps are struggling with this.
An example of legacy support added to a libssl-dependent app for guidance:
mtrojnar/osslsigncode#194
If legacy provider is not planned to be enabled by default, please consider allowing to enable this programmatically at least. Thank you.
The text was updated successfully, but these errors were encountered: