Example usage for com.squareup.okhttp Handshake peerCertificates

List of usage examples for com.squareup.okhttp Handshake peerCertificates

Introduction

In this page you can find the example usage for com.squareup.okhttp Handshake peerCertificates.

Prototype

List peerCertificates

To view the source code for com.squareup.okhttp Handshake peerCertificates.

Click Source Link

Usage

From source file:co.paralleluniverse.fibers.okhttp.RecordedResponse.java

License:Open Source License

public RecordedResponse assertHandshake() {
    Handshake handshake = response.handshake();
    assertNotNull(handshake.cipherSuite());
    assertNotNull(handshake.peerPrincipal());
    assertEquals(1, handshake.peerCertificates().size());
    assertNull(handshake.localPrincipal());
    assertEquals(0, handshake.localCertificates().size());
    return this;
}

From source file:io.apiman.gateway.platforms.servlet.connectors.ok.DelegatingHttpsURLConnection.java

License:Apache License

@Override
public Certificate[] getServerCertificates() throws SSLPeerUnverifiedException {
    Handshake handshake = handshake();
    if (handshake == null)
        return null;
    List<Certificate> result = handshake.peerCertificates();
    return !result.isEmpty() ? result.toArray(new Certificate[result.size()]) : null;
}