|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-06-03 21:45 UTC] christopher dot s dot ward at navy dot mil
Description:
------------
Environment: W2K, IIS V5.0, PHP 5.1.0-dev (I received identical results for PHP 5.0.3)
Problem: openssl_pkey_new() fails
I am running PHP 5.1.0-dev and OpenSSL 0.9.7c. Per the documentation, I have set the OPENSSL_CONF environment variable on my PHP server to point to the OPENSSL.CNF file. I have verified that libeay32.dll resides in the correct directory. I believe I have a "valid" openssl.cnf file, but it still doesn't work....
I have found comments indicating that this command works for others. Is the installation documentation for opensll complete?
Reproduce code:
---------------
<?php
$privkey = openssl_pkey_new();
while (($e = openssl_error_string()) !== false)
{ print($e . "<BR>");
}
?>
Expected result:
----------------
I expected $privkey to be a non-zero value. It isn't.
Actual result:
--------------
error:02001003:system library:fopen:No such process
error:2006D080:BIO routines:BIO_new_file:no such file
error:0E064002:configuration file routines:CONF_load:system lib
error:02001003:system library:fopen:No such process
error:2006D080:BIO routines:BIO_new_file:no such file
error:0E064002:configuration file routines:CONF_load:system lib
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 23:00:02 2025 UTC |
I respectfully disagree. Shouldn't the openssl_pkey_new() function should return a value? It doesn't. When I issue the following code: $privkey = openssl_pkey_new(); if($privkey) print("Private key is a non-zero value.<BR>"); else print("Private key is FALSE.<BR>"); I get the following: Private key is FALSE.$privateKey = openssl_pkey_new(); var_dump(getenv('OPENSSL_CONF')); var_dump(getenv('RANDFILE')); var_dump(getenv('HOME')); while($message = openssl_error_string()){ echo $message.'<br />'.PHP_EOL; } ===== string 'E:\easyphp\php\php546x130306104831\extras\openssl.cnf' (length=53) string '.rnd' (length=4) string 'E:\easyphp\php\php546x130306104831\extras' (length=41) 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 error:0E06D06C:configuration file routines:NCONF_get_string:no value error:0E06D06C:configuration file routines:NCONF_get_string:no value ===== http://stackoverflow.com/questions/15558321/openssl-configuration-on-windows- with-easyphp