| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 27 | private function getCertifacateInformation($host) |
||
| 28 | { |
||
| 29 | $sslOptions = stream_context_create(array('ssl' => array('capture_peer_cert' => true))); |
||
| 30 | |||
| 31 | $request = stream_socket_client( |
||
| 32 | 'ssl://' . $host . ':443', |
||
| 33 | $errno, |
||
| 34 | $errstr, |
||
| 35 | 30, |
||
| 36 | STREAM_CLIENT_CONNECT, |
||
| 37 | $sslOptions |
||
| 38 | ); |
||
| 39 | |||
| 40 | $content = stream_context_get_params($request); |
||
| 41 | $certinfo = openssl_x509_parse($content['options']['ssl']['peer_certificate']); |
||
| 42 | |||
| 43 | return $certinfo; |
||
| 44 | } |
||
| 45 | } |