@Override
    public void handshakeFailed(Event event, Throwable throwable) {
        log.log(Level.FINE, throwable, () -> "Ssl handshake failed: " + throwable.getMessage());
        String metricName = SslHandshakeFailure.fromSslHandshakeException((SSLHandshakeException) throwable)
                .map(SslHandshakeFailure::metricName)
                .orElse(MetricDefinitions.SSL_HANDSHAKE_FAILURE_UNKNOWN);
        metric.add(metricName, 1L, metric.createContext(createDimensions(event)));
    }
@Test
    void does_not_include_client_ip_dimension_present_when_peer_unavailable() {
        listener.handshakeFailed(handshakeEvent(false), new SSLHandshakeException("Empty server certificate chain"));
        verify(metrics).createContext(eq(Map.of("serverName", "connector", "serverPort", 1234)));
    }