Bug #51647 [NEW]: Certificate file without private key (pk in another file) doesn't work

From: Date: Fri, 23 Apr 2010 13:38:44 +0000
Subject: Bug #51647 [NEW]: Certificate file without private key (pk in another file) doesn't work
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-149815@lists.php.net to get a copy of this message
From:             
Operating system: Linux
PHP version:      5.3SVN-2010-04-23 (SVN)
Package:          OpenSSL related
Bug Type:         Bug
Bug description:Certificate file without private key (pk in another file) doesn't work

Description:
------------
If a user has a certificate file (pem) with only the public key, and the
private key in another file he cannot use them by pushing down to the
stream by using a context. The user is forced to put keys in the same file,
which is not always possible.

Test script:
---------------
From the sources:
		if (VCWD_REALPATH(certfile, resolved_path_buff)) {
			/* a certificate to use for authentication */
			if (SSL_CTX_use_certificate_chain_file(ctx, resolved_path_buff) != 1) {
				php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set local cert
chain file `%s'; Check that your cafile/capath settings include details of
your certificate and its issuer", certfile);
				return NULL;
			}

			if (SSL_CTX_use_PrivateKey_file(ctx, resolved_path_buff,
SSL_FILETYPE_PEM) != 1) {
				php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set private key
file `%s'", resolved_path_buff);
				return NULL;
			}



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



Thread (11 messages)

« previous php.bugs (#149815) next »