note 93618 added to function.openssl-csr-new
| From: | The_Lost_One at osu1 dot php dot net | Date: | Fri, 18 Sep 2009 14:45:18 +0000 |
| Subject: | note 93618 added to function.openssl-csr-new | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-160830@lists.php.net to get a copy of this message | ||
Not sure whether the "bug" (undocumented behavior) I encountered is common to other
people, but this comment might save hours of painful debug:
If you can't generate a new private key using openssl_pkey_new() or openssl_csr_new(), your
script hangs during the call of these functions and in case you specified a
"private_key_bits" parameter, ensure that you cast the variable to an int. Took me ages to
notice that.
<?php
$SSLcnf = array('config' => '/usr/local/nessy2/share/ssl/openssl.cnf',
'encrypt_key' => true,
'private_key_type' => OPENSSL_KEYTYPE_RSA,
'digest_alg' => 'sha1',
'x509_extensions' => 'v3_ca',
'private_key_bits' => $someVariable // ---> bad
'private_key_bits' => (int)$someVariable // ---> good
'private_key_bits' => 512 // ---> obviously good
);
?>
----
Server IP: 195.221.21.36
Probable Submitter: 82.226.168.45
----
Manual Page -- http://www.php.net/manual/en/function.openssl-csr-new.php
Edit -- https://master.php.net/note/edit/93618
Del: integrated -- https://master.php.net/note/delete/93618/integrated
Del: useless -- https://master.php.net/note/delete/93618/useless
Del: bad code -- https://master.php.net/note/delete/93618/bad+code
Del: spam -- https://master.php.net/note/delete/93618/spam
Del: non-english -- https://master.php.net/note/delete/93618/non-english
Del: in docs -- https://master.php.net/note/delete/93618/in+docs
Del: other reasons-- https://master.php.net/note/delete/93618
Reject -- https://master.php.net/note/reject/93618
Search -- https://master.php.net/manage/user-notes.php