Issues with OpenSSL on PHP - different behaviour for different versions

筅森魡賤 提交于 2019-11-29 15:42:49
binwiederhier

According to this post, the issue is related to different OpenSSL versions of Apache and PHP in the XAMPP/Windows installation. I had a similar issue with openssl_verify. I solved it by using the same OpenSSL version for both Apache and PHP (replacing DLLs). Here's a link to the solution.

"I found a solution for the problem, it seems there are 2 wrong files in /apache/bin/ in the default 1.7.7 installation that need to be replaced by the files existing in /php/ (libeay32.ddl and ssleay32.dll)"

Ariful Islam Rajib

You passed the wrong parameter of openssl_public_encrypt

openssl_public_encrypt($data, $encrypted_data, $key1, OPENSSL_PKCS1_PADDING)

where $key1 is the resource id use $key instead of $key1. You can use

openssl_public_encrypt($data, $encrypted_data, $key, OPENSSL_PKCS1_PADDING)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!