$ tools/php-5.2.17/bin/php test1.php * About to connect() to www.google.com port 443 (#0) * Trying 74.125.192.103… * connected * Connected to www.google.com (74.125.192.103) port 443 (#0) * Initializing NSS with certpath: sql:/etc/pki/nssdb Segmentation fault (core dumped)When the url in the script is changed to use HTTP instead of HTTPS, there is no segfault. |
|||||
Steps To Reproduce | Run the script: $ cat test1.php < ?php $urlEndPoint = “https://www.google.com/search”; $headerArray = array(); $ch = curl_init(); curl_setopt($ch,CURLOPT_POST,true);curl_setopt($ch,CURLOPT_URL, $urlEndPoint); /*curl_setopt($ch,CURLOPT_HTTPHEADER, $headerArray); curl_setopt($ch, CURLOPT_POSTFIELDS, $postArray); */ curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); if (!$result = curl_exec($ch)) { curl_close ($ch); echo print_r($result,true); |
---|
在Centos的bug列表中,能够找到关于这个bug的说明:
https://bugs.centos.org/view.php?id=7399
https://www.mankier.com/5/cert9.db
Quick fix:
mv /etc/pki/nssdb /etc/pki/nssdb.bak
yum -y reinstall nss