0
I’m trying to use the openssl_pkey_new command, it was working very well on wamp, but when using xampp it stopped.
The code is like this:
$sslConfig = array(
"digest_alg" => "sha512",
"private_key_bits" => 2048,
"private_key_type" => OPENSSL_KEYTYPE_RSA
);
$privkey = openssl_pkey_new($sslConfig);
The error that this presenting 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 did pointed out that the error is in openssl.cnf file, but I’ve tried everything to work and so far did not get a positive result just the same above error.
I set the file path in httpd-xampp.conf, all I found in the xampp folder, I also tried what I had in wamp folder, I even tried to install openssl in windows and set the openssl.cnf from it and it also didn’t work(I even tried to put openssl in the environment variables just to "consciousness-raising").
I tried to add the path also using config in php itself, this way:
$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 by printing the getenv('OPENSSL_CONF') command shows the path I configured in httpd-xampp.conf, whether or not I put it in $sslConfig:
C:\xampp\htdocs\Carteira\openssl.cnf
I checked if the path was correct several times, including using the command file_exists, to be 100% sure, and yes the path is right, it returns 1.
echo file_exists(getenv('OPENSSL_CONF'));