3

I use php curl to visit https website such as "https://api.mch.weixin.qq.com" in a php-fpm environment, the code is:

    <?php
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_URL, 'https://api.mch.weixin.qq.com');
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    $verbose = fopen('php://temp', 'w+');
    curl_setopt($ch, CURLOPT_STDERR, $verbose);
    curl_setopt($ch, CURLOPT_POST, TRUE );
    curl_setopt($ch, CURLOPT_POSTFIELDS, 'test');
    $data = curl_exec($ch );
    if ($data === FALSE) {
        $error = curl_errno($ch) . ' ' . curl_error($ch);
        echo $error;
        rewind($verbose);
        $verboseLog = stream_get_contents($verbose);
        echo "Verbose information:\n<pre>", htmlspecialchars($verboseLog), "</pre>\n";
    } else {
        echo 'ok';
    }

the verbose info is:

    * About to connect() to api.mch.weixin.qq.com port 443 (#0)
    *   Trying 101.226.129.200... * connected
    * Connected to api.mch.weixin.qq.com (101.226.129.200) port 443 (#0)
    * Initializing NSS with certpath: sql:/etc/pki/nssdb
    * Unable to initialize NSS database
    * Initializing NSS with certpath: none
    * Unable to initialize NSS
    * NSS error -5925
    * Closing connection #0
    * Problem with the SSL CA cert (path? access rights?)

the above error not always happend, and after i restart php-fpm, it is ok.

what is this error? how to solve it?

note: i havent update my centos os recently.

i found that if i move either one of these two file away, the problem occured:

/usr/lib64/libsoftokn3.so
/usr/lib64/libsqlite3.so.0 

but these two file is always there.

my curl version is:

    # curl --version
    curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
    Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
    Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

my os is:

    Linux web-www 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
youly
  • 61
  • 7
  • PR_CALL_ONCE_ERROR = -5925 PR_CALL_ONCE_ERROR: The one-time function was previously called and failed. Its error code is no longer available. – malyy Jun 02 '16 at 08:42

0 Answers0