I'm trying to use the openssl_pkey_new command, it was working fine in wamp, but when using xampp it stopped.
The code looks like this:
$sslConfig = array(
"digest_alg" => "sha512",
"private_key_bits" => 2048,
"private_key_type" => OPENSSL_KEYTYPE_RSA
);
$privkey = openssl_pkey_new($sslConfig);
The error you are experiencing is this:
error:0E06D06C:configuration file routines:NCONF_get_string:no value error:0E06D06C:configuration file routines:NCONF_get_string:no value error:0E06D06C:configuration file routines:NCONF_get_string:no value error:0E06D06C:configuration file routines:NCONF_get_string:no value
All the searches I've done have pointed out that the error is in the openssl.cnf file, but I've tried everything to work and so far I have not got a positive result just the same error above.
I seted the file path in httpd-xampp.conf, all that I found in the xampp folder, I also tried what I had in the wamp folder, I tried to install openssl on windows and set up openssl.cnf, and also did not work (I tried putting openssl in the environment variables just for "disengagement of consciousness").
I tried to add the path also using the config in php itself, like this:
$sslConfig = array(
"config" => 'C:\xampp\htdocs\Carteira\openssl.cnf',
"digest_alg" => "sha512",
"private_key_bits" => $tamanho,
"private_key_type" => OPENSSL_KEYTYPE_RSA
);
And the result remains the same, when you start the command getenv ('OPENSSL_CONF') shows the path I set up in httpd-xampp.conf, whether or not you put it in $ sslConfig:
C:\xampp\htdocs\Carteira\openssl.cnf
I checked if the path was correct several times, I even used the file_exists command, to be 100% certain, and yes the path is right, it returns 1.
echo file_exists(getenv('OPENSSL_CONF'));