org.eclipse.jetty.io.ssl.SslHandshakeListener Java Examples

The following examples show how to use org.eclipse.jetty.io.ssl.SslHandshakeListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JettySslHandshakeMetricsTest.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Test
void handshakeFailed() {
    SslHandshakeListener.Event event = new SslHandshakeListener.Event(engine);
    sslHandshakeMetrics.handshakeFailed(event, new javax.net.ssl.SSLHandshakeException(""));
    assertThat(registry.get("jetty.ssl.handshakes")
                       .tags("id", "0", "protocol", "unknown", "ciphersuite", "unknown", "result", "failed")
                       .counter().count()).isEqualTo(1.0);
}
 
Example #2
Source File: JettySslHandshakeMetricsTest.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Test
void handshakeSucceeded() {
    SslHandshakeListener.Event event = new SslHandshakeListener.Event(engine);
    when(session.getProtocol()).thenReturn("TLSv1.3");
    when(session.getCipherSuite()).thenReturn("RSA_XYZZY");
    sslHandshakeMetrics.handshakeSucceeded(event);
    assertThat(registry.get("jetty.ssl.handshakes")
                       .tags("id", "0", "protocol", "TLSv1.3", "ciphersuite", "RSA_XYZZY", "result", "succeeded")
                       .counter().count()).isEqualTo(1.0);
}