Snoopy PHP is unable to get the content of the HTTPS web page

Article From:https://segmentfault.com/q/1010000011142101

Question:

Access to HTTP content can be obtained, but access to HTTPS is not able to get the relevant content.The test code is as follows: (when testing HTTPS, the http://www.xxxx.com is changed to https://www.xxxx.com).

What other special settings do you need when you use Snoopy to get HTTPS content?

Supplement: php.ini’s OpenSSL is opened, and then a test is done. After apt-get install php7.0-cli on the server, PHP tester.php is executed directly, then both HTTP and HTTPS are available.To get the content.

The original server is apache2.4+php5.6, which can only get HTTP, but is unable to get HTTPS.

Some strange, still looking for the reason

snoopyThe class is as follows, the source code on the GitHub is not changed

Supplement: php.ini’s OpenSSL is opened, and then a test is done. After apt-get install php7.0-cli on the server, PHP tester.php is executed directly, then both HTTP and HTTPS are available.To get the content.

The original server is apache2.4+php5.6, which can only get HTTP, but is unable to get HTTPS.