error openssl_csr_sign() help me plz...

Problems with the Windows version of XAMPP, questions, comments, and anything related.

error openssl_csr_sign() help me plz...

Postby poweronline007 » 15. January 2008 06:29

Code:

// Let's assume that this script is set to receive a CSR that has
// been pasted into a textarea from another page
$fp=fopen("C:/xampp/apache/conf/ssl.csr/test.csr","r");
$cacert = fread($fp, filesize("C:/xampp/apache/conf/ssl.csr/test.csr"));
fclose($fp);
$csrdata =$cacert;

// We will sign the request using our own "certificate authority"
// certificate. You can use any certificate to sign another, but
// the process is worthless unless the signing certificate is trusted
// by the software/users that will deal with the newly signed certificate

// We need our CA cert and its private key

$cacert="C:/xampp/apache/conf/CA/serverCA.crt";

$privkey = array("C:/xampp/apache/conf/CA/serverCA.key", "password");

$userscert = openssl_csr_sign($csrdata, $cacert, $privkey, 365);

// Now display the generated certificate so that the user can
// copy and paste it into their local configuration (such as a file
// to hold the certificate for their SSL server)
/*openssl_x509_export($usercert, $certout);
echo $certout;*/


// Show any errors that occurred here
while (($e = openssl_error_string()) !== false) {
echo $e . "\n";
}

Output:

Warning: openssl_csr_sign() [function.openssl-csr-sign]: cannot get cert from parameter 2 in C:\xampp\htdocs\test.php on line 21
error:0906D06C:PEM routines:PEM_read_bio:no start line


I have a problem this code.Do I must edit this code?
poweronline007
 
Posts: 7
Joined: 03. January 2008 18:56

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 230 guests