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

From: Date: Fri, 23 Apr 2010 14:30:09 +0000
Subject: Bug #51647 [Csd->Asn]: Certificate file without private key (pk in another file) doesn't work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-149822@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51647&edit=1

 ID:               51647
 Updated by:       pajoye@php.net
 Reported by:      andrey@php.net
 Summary:          Certificate file without private key (pk in another
                   file) doesn't work
-Status:           Closed
+Status:           Assigned
 Type:             Bug
 Package:          OpenSSL related
 Operating System: Linux
 PHP Version:      5.3SVN-2010-04-23 (SVN)
-Assigned To:      andrey
+Assigned To:      pajoye

 New Comment:

To open a bug, commit the same wrong thing and close the bug does not
solve anything. I mailed you what I'm expecting.


Previous Comments:
------------------------------------------------------------------------
[2010-04-23 15:56:21] andrey@php.net

Addressed in 5.3.3

------------------------------------------------------------------------
[2010-04-23 15:54:42] andrey@php.net

Automatic comment from SVN on behalf of andrey
Revision: http://svn.php.net/viewvc/?view=revision&revision=298374
Log: Fix for bug #51647 Certificate file without private key (pk in
another file) doesn't work

------------------------------------------------------------------------
[2010-04-23 15:38:43] andrey@php.net

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 this bug report at http://bugs.php.net/bug.php?id=51647&edit=1


Thread (11 messages)

« previous php.bugs (#149822) next »