Openssl functions cannot be used in https. in Linux + apache2 + php5, configure ssl to allow https access and run the test code:
After running, the page prompts that the server cannot be connected.
After testing, the problem is that the openssl_public_encrypt () function cannot be executed.
The openssl_get_publickey () function passes normally, but the openssl_public_encrypt () function disconnects apache.
Run directly in the background:/path/php-f ssl-encry.php, only 1, 2 have results, 3rd is null.
Test normal output in Windows.
How can this problem be solved?
Reply to discussion (solution)
The openssl_get_publickey () function passes normally, but the openssl_public_encrypt () function disconnects apache.
Query apache error logs
1. because the ssl versions of apache and php are inconsistent, re-configure the same ssl to run.
2. the execution result is still in the range of 1 and 2, and the value of 3rd is null.
Why?
Solution:
The permissions of the certificate and the key are different. you can change them to 0755.