つい最近、Web サーバーの https:// アドレスへの curl リクエストに対して、サーバーが機能しなくなりました。少し調べてみると、Web サーバーを実行しているユーザーに問題があるようです。
root としてサーバーに SSH 接続して呼び出す場合
curl -I -v https://google.com
...次の応答が得られます...
* About to connect() to google.com port 443 (#0)
* Trying 173.194.67.113... connected
* Connected to google.com (173.194.67.113) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* SSL connection using SSL_RSA_WITH_RC4_128_SHA
* Server certificate:
* subject: CN=*.google.com,O=Google Inc,L=Mountain View,ST=California,C=US
* start date: May 22 15:50:20 2013 GMT
* expire date: Oct 31 23:59:59 2013 GMT
* common name: *.google.com
* issuer: CN=Google Internet Authority,O=Google Inc,C=US
> HEAD / HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: google.com
> Accept: */*
ただし、cPanel アカウントのいずれかとしてログインすると (Web サーバー経由で実行するときにも使用されます)、次のようになります...
* About to connect() to google.com port 443 (#0)
* Trying 173.194.67.101... connected
* Connected to google.com (173.194.67.101) port 443 (#0)
* Initializing NSS with certpath: none
* NSS error -5978
* Closing connection #0
* Problem with the SSL CA cert (path? access rights?)
curl: (77) Problem with the SSL CA cert (path? access rights?)
この問題に対する決定的な答えを見つけることができませんでした。私のホスティング会社は、先週は問題なく動作していましたが、「サポート対象外」であるため、支援を拒否しています!
http://curl.haxx.se/docs/sslcerts.htmlでその言及を見つけました
「libcurl が NSS サポート付きでビルドされている場合、OS ディストリビューションによっては、システム全体の CA cert db を使用するために追加の手順を実行する必要がある可能性があります。RedHat には追加モジュール libnsspem.so が同梱されており、NSS がOpenSSL PEM CA バンドルを読んでください。このライブラリは OpenSuSE にはありません。これがないと、NSS は独自の内部形式でしか機能しません。NSS には新しいデータベース形式もあります: https://wiki.mozilla.org/NSS_Shared_DB "
...しかし、CentOSサーバーでシステム全体でこれを機能させる方法に関する情報は見つかりません。
情報
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 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
これが突然変更された理由、またはそれを修正する方法について、誰かが光を当てることができますか?
ありがとう