note 119877 added to function.openssl-pkey-get-public
| From: | Joey | Date: | Mon, 12 Sep 2016 15:24:11 +0000 |
| Subject: | note 119877 added to function.openssl-pkey-get-public | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-206566@lists.php.net to get a copy of this message | ||
I spent a few hours raging with this function and hitting my head on the desk trying to get it to
load a public PEM key.
This function can leave errors in openssl_error_string even if it succeeded so this can cause a lot
of confusion further down. Especially if you're prototyping and haven't put full checks on
return values in yet. The error will not be cleared either when calling other functions
successfully.
To avoid confusion, you should always check the return result and only call openssl_error_string
after calling an openssl function that returned failure (false).
----
Server IP: 72.52.91.14
Probable Submitter: 149.6.187.130
----
Manual Page -- http://php.net/manual/en/function.openssl-pkey-get-public.php
Edit -- https://master.php.net/note/edit/119877
Del: integrated -- https://master.php.net/note/delete/119877/integrated
Del: useless -- https://master.php.net/note/delete/119877/useless
Del: bad code -- https://master.php.net/note/delete/119877/bad+code
Del: spam -- https://master.php.net/note/delete/119877/spam
Del: non-english -- https://master.php.net/note/delete/119877/non-english
Del: in docs -- https://master.php.net/note/delete/119877/in+docs
Del: other reasons-- https://master.php.net/note/delete/119877
Reject -- https://master.php.net/note/reject/119877
Search -- https://master.php.net/manage/user-notes.php