|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-10-28 11:48 UTC] zeusgerde at arcor dot de
Description: ------------ setting OPENSSL_CONF is ignored in openssl* functions despite the documentation lists it as the first location where the configuration file is searched http://de2.php.net/manual/en/openssl.installation.php Test script: --------------- <?php header('Content-Type: text/plain'); echo "Current PHP version: ", phpversion(), "\n"; echo "*** OPENSSL_CONF\n"; var_dump(getenv('OPENSSL_CONF')); echo "\n*** Errors before calling openssl_pkey_new\n"; while (($e = openssl_error_string()) !== false) { var_dump($e); } echo "\n*** Calling openssl_pkey_new\n"; var_dump(openssl_pkey_new()); echo "\n*** Errors after calling openssl_pkey_new\n"; while (($e = openssl_error_string()) !== false) { var_dump($e); } Expected result: ---------------- Current PHP version: 5.3.8 *** OPENSSL_CONF string(42) "D:\sandbox\openssl.cnf" *** Errors before calling openssl_pkey_new *** Calling openssl_pkey_new resource(2) of type (OpenSSL key) *** Errors after calling openssl_pkey_new Actual result: -------------- Current PHP version: 5.3.8 *** OPENSSL_CONF string(42) "D:\sandbox\openssl.cnf" *** Errors before calling openssl_pkey_new *** Calling openssl_pkey_new bool(false) *** Errors after calling openssl_pkey_new string(51) "error:02001003:system library:fopen:No such process" string(53) "error:2006D080:BIO routines:BIO_new_file:no such file" string(63) "error:0E064002:configuration file routines:CONF_load:system lib" string(51) "error:02001003:system library:fopen:No such process" string(53) "error:2006D080:BIO routines:BIO_new_file:no such file" string(63) "error:0E064002:configuration file routines:CONF_load:system lib" Patchescall_OPENSSL_config (last revision 2017-09-21 09:28 UTC by VadimZelenin at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 05:00:02 2025 UTC |
BTW, this is the work-around var_dump(openssl_pkey_new(array( 'config' => getenv('OPENSSL_CONF'), )));Where do you set it? System wild? manually in your script? try: putenv("OPENSSL_CONF=whereyouwanit"); .. rest of your code.. Only to verify a possible cause.> Where do you set it? System wild? manually in your script? In httpd.conf in a global scope: | SetEnv OPENSSL_CONF D:\sandbox\openssl.cnf You can see that it is set in the actual result: | var_dump(getenv('OPENSSL_CONF')); | // string(42) "D:\sandbox\openssl.cnf" (hint: don't look at the string length, I scrambled the path in this bug report) > putenv("OPENSSL_CONF=whereyouwanit"); No change in the actual result. Even if I do this: | putenv("OPENSSL_CONF=", getenv('OPENSSL_CONF')); It only works if I use the $configargs parameter directly (see my first comment at 2011-10-28 11:48 UTC)