TOP › Forums › バグ報告と提案(Requests and Feedback) › kusanagi-php7 7.2.5-1でcURLなどからの外部HTTPSサイトへの接続でエラー
Tagged: cURL SSL HTTPS 7.2.5
- This topic has 7 replies, 3 voices, and was last updated 8 years, 3 months ago by
collne.
-
AuthorPosts
-
-
2018年5月18日 at 17:19 #392
yousan
Participantこんにちは。
NGINX + PHP-FPM(7.2.5-1)を利用していて、相手方の証明書にエラーはなさそうなのですが( https://twitter.com や https://facebook.com など)、外部サイトへのHTTPS接続時にエラーが出ます。
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mnt/example.com/test.php on line 4 Warning: file_get_contents(): Failed to enable crypto in /mnt/example.com/test.php on line 4 Warning: file_get_contents(https://example.com/test.jpg): failed to open stream: operation failed in /mnt/example/test.php on line 4利用しているバージョンは下記です。
kusanagi-php7.noarch 7.2.5-1 @kusanagi同じコードをkusanagi(PHP-FPM 7.0系)で動かすとエラーは出ません。
下記のように相手方SSLの認証を入れないようにすると動きます。
https://teratail.com/questions/83578またHHVM (Version 3.19.2-dev)にするとエラーはでません。
今回の件について: https://qiita.com/yousan/items/4c98cbee20b2d89e91a3opensslのデフォルトコンフィグが変わってしまったことなどが原因かなと推測していますが…、調査や解決の方法などありそうでしょうか?
-
2018年6月28日 at 15:15 #399
collne
Participantこんにちは。
私もnginx php7 で運用していますが同じ症状を確認しています。
証明書もいくつか変えてみましたが変わりありませんでした。 -
2018年6月28日 at 15:17 #400
yousan
Participant@collne
どうもです! ちょうど先ほど解決できました。
今記事にまとめていますが下記のように証明書を指定すれば解決しそうです。sudo git diff /etc/php7.d/php.ini diff --git a/php7.d/php.ini b/php7.d/php.ini index f122a10..254264d 100644 --- a/php7.d/php.ini +++ b/php7.d/php.ini @@ -1864,6 +1864,7 @@ ldap.max_links = -1 ; be overridden on a per-stream basis via the "cafile" SSL stream context ; option. ;openssl.cafile= +openssl.cafile=/etc/ssl/certs/ca-bundle.crt ; If openssl.cafile is not specified or if the CA file is not found, the ; directory pointed to by openssl.capath is searched for a suitable -
2018年6月28日 at 15:26 #401
yousan
ParticipantQiitaにまとめました。
証明書を指定すれば解決しました。 -
2018年6月28日 at 16:04 #402
collne
Participantうまく行きました!
ありがとうございます。しかし、初期値ではどこの証明書を見に行ってるんでしょうね。
PHP5.6の時は、ここは設定しなくても大丈夫だという事は、やはり初期のファイルパスがあるような気がします。 -
2018年6月28日 at 22:54 #403
yousan
Participant@collne
うまくいけてよかったですー。
そうなんです、過去のバージョンだと指定しなくても問題なかったですよね。
PHPか、opensslモジュールのバージョンアップでデフォルトが変わったっぽいですよね。 -
2018年7月4日 at 11:02 #404
優也田島
Keymaster上記問題の件、下記のKUSANAGIのアップデートで対応致しました。
-
2018年7月4日 at 11:49 #405
collne
Participant早速のアップデート、ありがとうございます。
-
-
AuthorPosts
- You must be logged in to reply to this topic.