ID: 37374 User updated by: bassijunior at gmail dot com Reported By: bassijunior at gmail dot com Status: Bogus Bug Type: OpenSSL related Operating System: Windows XP PHP Version: 5.1.4 New Comment:
Now I´m using the new version, but the problem continues. The same problem!! Can be anything about openssl library? Previous Comments: ------------------------------------------------------------------------ [2006-05-10 10:16:03] [EMAIL PROTECTED] Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. ------------------------------------------------------------------------ [2006-05-09 01:25:27] bassijunior at gmail dot com Description: ------------ I'm using a PHP 5.1.1, but I have a folowing problem: I made a code that was to sign a request. I used almost all the code from PHP page. I made some modifications. The openssl_csr_sign function doesn´t work. Please, help me!!! Reproduce code: --------------- // You will usually want to create a self-signed certificate at this // point until your CA fulfills your request. // This creates a self-signed cert that is valid for 365 days $cacert = "C:\demoCA\cacert.pem"; $privkey_ca = array("C:\demoCA\private\cakey.pem", "junior"); $req_cert = "C:\demoCA\csr_2.pem"; var_dump($req_cert); $usercert = openssl_csr_sign($req_cert, $cacert, $privkey_ca, 365); if($usercert) { echo " A requisicao foi assinada</br>"; } else { echo "Erro : A requisicao nao foi assinada</br>"; } var_dump($usercert); openssl_x509_export_to_file($usercert, "C:\demoCA\user_cert_signed.pem"); /* // Show any errors that occurred here while (($e = openssl_error_string()) !== false) { echo $e . "\n"; } */ ?> Expected result: ---------------- I expect that my request is signed by CA that I created. I made previously the request using the openssl_csr_new() function. Actual result: -------------- The result was: string(19) "C:\demoCA\csr_2.pem" Warning: openssl_csr_sign() [function.openssl-csr-sign]: cannot get CSR from parameter 1 in C:\xampp\xampp\htdocs\teste_php\criando_certificado_auto_assinado_teste.php on line 24 Erro : A requisicao nao foi assinada bool(false) Warning: openssl_x509_export_to_file() expects parameter 1 to be resource, boolean given in C:\xampp\xampp\htdocs\teste_php\criando_certificado_auto_assinado_teste.php on line 38 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37374&edit=1
