handle connection failure
This commit is contained in:
parent
4c69cf585b
commit
8daccb2ef9
@ -104,6 +104,11 @@ function ssl_expire_notifier() {
|
|||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
$read = stream_socket_client('ssl://'.$host.':'.$port, $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $get);
|
$read = stream_socket_client('ssl://'.$host.':'.$port, $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $get);
|
||||||
|
if ($read === false) {
|
||||||
|
$logger->error("failed to connect to {$host}:{$port}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$cert = stream_context_get_params($read);
|
$cert = stream_context_get_params($read);
|
||||||
$cert_info = openssl_x509_parse($cert['options']['ssl']['peer_certificate']);
|
$cert_info = openssl_x509_parse($cert['options']['ssl']['peer_certificate']);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user