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
Incorrect openssl.cnf location for PHP 7.3 images #564
Comments
@stronk7 You can create a conf file in a step above your tests and provide its path to the options in |
@mlocati Can this be solved in |
Aha, thanks @shivammathur, yeah, I was aware it can be changed both via env variable and also, in php code (that I prefer not to modify) . Just was prospecting if, at some level (here in the snapshots, I did not know you are not building the old ones), or in the action, or maybe in the environments themselves, that could be changed somehow and allow it to work “by default”. Thanks! |
Can't you simply write this somewhere? $Env:OPENSSL_CONF = 'C:\Path\to\openssl.cnf' |
GitHub Actions does not carry over environment variables from one step to another as it starts a new shell. It would have to be set in |
PS: I also am working on it: https://github.com/mlocati/powershell-phpmanager/commits/fix-openssl_conf-path (No ETA though) |
@mlocati That looks great, will use it once released. |
Heap thanks, @shivammathur & @mlocati ! |
I've just published a new version of Powershell PhpManager (1.26.0).
PS: PHP comes with a sample |
Added support in 7ad352e Test workflow: https://github.com/shivammathur/test-setup-php/actions/runs/1834950656/workflow |
Added in |
I can confirm that, now, previous PHPUnit runs affected by this (PHP 7.3) are now passing perfectly. Link: https://github.com/stronk7/moodle/runs/5378218227 Heap thanks! |
Describe the bug
PHP with openssl comes with the following default paths to locate the (mandatory for some operations), openssl.cnf file:
(source: PHP Manual: OpenSSL >Installing/Configuring)
And those are the values, that the snapshots built here have. From this run, that is plenty of var_dump() information, I can see that:
Openssl default config => C:\usr\local\ssl/openssl.cnf
Openssl default config => C:\Program Files\Common Files\SSL/openssl.cnf
So, all right so far.
The problem is that the
C:\usr\local\ssl/openssl.cnf
file DOES NOT exist in the 7.3 environment, only theC:\Program Files\Common Files\SSL/openssl.cnf
is there. The job above also tries tovar_dump()
the contents of the 2 files and only the later is there, both in the 7.3 and 8.0 snapshots.And that leads to all sort of failures with various openssl operations requiring a valid openssl.cnf, for example:
In theory, that problem can be workaround by setting some env variable (
OPENSSL_CONF
, ...)pointing to the later file but, ideally, it should work without requiring that.So, somehow, that default
Openssl default config
should be pointing to the existing (later) file or, alternatively, that file should be copied to the former location so PHP 7.3 is able to find it.Version
Operating systems
To Reproduce
Expected behavior
A private key is generated and printed, without any PHP Warning
Screenshots/Logs
output / error log shows:
PHP Warning: openssl_pkey_export(): cannot get key from parameter 1 in...
Are you willing to submit a PR?
Sorry, I'm not able to help with that... in fact I was not sure if this issue corresponds to this, to
setup-php
or to the environments themselves, noob here, specially with Windows stuff.If I can help with anything else, glad to help. Ciao :-)
The text was updated successfully, but these errors were encountered: