Bug #60157 [NEW]: OPENSSL_CONF environment variable ignored

From: Date: Fri, 28 Oct 2011 11:48:36 +0000
Subject: Bug #60157 [NEW]: OPENSSL_CONF environment variable ignored
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-164633@lists.php.net to get a copy of this message
From:             
Operating system: Windows XP and Windows 7
PHP version:      5.3.8
Package:          OpenSSL related
Bug Type:         Bug
Bug description:OPENSSL_CONF environment variable ignored

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"

-- 
Edit bug report at https://bugs.php.net/bug.php?id=60157&edit=1
-- 
Try a snapshot (PHP 5.4):            https://bugs.php.net/fix.php?id=60157&r=trysnapshot54
Try a snapshot (PHP 5.3):            https://bugs.php.net/fix.php?id=60157&r=trysnapshot53
Try a snapshot (trunk):              https://bugs.php.net/fix.php?id=60157&r=trysnapshottrunk
Fixed in SVN:                        https://bugs.php.net/fix.php?id=60157&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60157&r=needdocs
Fixed in release:                    https://bugs.php.net/fix.php?id=60157&r=alreadyfixed
Need backtrace:                      https://bugs.php.net/fix.php?id=60157&r=needtrace
Need Reproduce Script:               https://bugs.php.net/fix.php?id=60157&r=needscript
Try newer version:                   https://bugs.php.net/fix.php?id=60157&r=oldversion
Not developer issue:                 https://bugs.php.net/fix.php?id=60157&r=support
Expected behavior:                   https://bugs.php.net/fix.php?id=60157&r=notwrong
Not enough info:                     https://bugs.php.net/fix.php?id=60157&r=notenoughinfo
Submitted twice:                     https://bugs.php.net/fix.php?id=60157&r=submittedtwice
register_globals:                    https://bugs.php.net/fix.php?id=60157&r=globals
PHP 4 support discontinued:          https://bugs.php.net/fix.php?id=60157&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=60157&r=dst
IIS Stability:                       https://bugs.php.net/fix.php?id=60157&r=isapi
Install GNU Sed:                     https://bugs.php.net/fix.php?id=60157&r=gnused
Floating point limitations:          https://bugs.php.net/fix.php?id=60157&r=float
No Zend Extensions:                  https://bugs.php.net/fix.php?id=60157&r=nozend
MySQL Configuration Error:           https://bugs.php.net/fix.php?id=60157&r=mysqlcfg



Thread (10 messages)

« previous php.bugs (#164633) next »