For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > June 2005 > #33237 [Opn->Csd]: openssl_pkey_new() fails









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #33237 [Opn->Csd]: openssl_pkey_new() fails
christopher dot s dot ward at navy dot mil

2005-06-09, 8:56 pm

ID: 33237
User updated by: christopher dot s dot ward at navy dot mil
Reported By: christopher dot s dot ward at navy dot mil
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Windows 2000
PHP Version: Irrelevant
New Comment:

It started working. I don't know why. I am closing the bug report.


Previous Comments:
------------------------------------------------------------------------

[2005-06-08 19:41:40] christopher dot s dot ward at navy dot mil

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.

------------------------------------------------------------------------

[2005-06-07 12:16:03] vrana@php.net

So it works - "NCONF_get_string:no value" is only some kind of notice.

------------------------------------------------------------------------

[2005-06-06 19:32:19] christopher dot s dot ward at navy dot mil

Per your request, I put a copy of the distributed OPENSSL.CNF file in
the default location (c:\usr\local\ssl). No change in results.
I then re-directed the OPENSSL_CONF environment variable to this new
location and rebooted the box. It still fails, but with different
error messages:

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
error:0E06D06C:configuration file routines:NCONF_get_string:no value

== Output from var_dump(getenv(OPENSSL_CONF)) ==
string(28) "C:\usr\local\ssl\openssl.cnf"

------------------------------------------------------------------------

[2005-06-06 17:41:09] vrana@php.net

Can you please copy the distributed openssl.cnf to the default location
c:\usr\local\ssl\? If it helps, try to copy yours openssl.cnf there. If
it still works, try <?php var_dump(getenv(OPENSSL_CONF)); ?> so that we
can see where the problem lies.

------------------------------------------------------------------------

[2005-06-03 21:45:13] 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



------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=33237&edit=1
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com