回答編集履歴
1
参考コードの追加
answer
CHANGED
@@ -1,2 +1,11 @@
|
|
1
1
|
以下のサイトが参考になるのではないでしょうか。
|
2
|
-
[参考サイト](http://stackoverflow.com/questions/3081042/how-to-get-ssl-certificate-info-with-curl-in-php)
|
2
|
+
[参考サイト](http://stackoverflow.com/questions/3081042/how-to-get-ssl-certificate-info-with-curl-in-php)
|
3
|
+
|
4
|
+
```php
|
5
|
+
$g = stream_context_create (array("ssl" => array("capture_peer_cert" => true)));
|
6
|
+
$r = fopen("https://www.google.com/", "rb", false, $g);
|
7
|
+
$cont = stream_context_get_params($r);
|
8
|
+
$parsed = openssl_x509_parse($cont['options']['ssl']['peer_certificate']);
|
9
|
+
```
|
10
|
+
|
11
|
+
$parsedの中に、SSLの情報が入ります。
|