SSL Support
The simplest way to enable SSL support in the client is to use the
{@link oajrc.RestClientBuilder#enableLaxSSL()} method.
// Create a client that ignores self-signed or otherwise invalid certificates.
RestClient rc = RestClient.create().enableLaxSSL().build();
A more typical scenario using default cert and hostname verification is shown here:
RestClient rc = RestClient.create().enableSSL().sslProtocols("TLSv1.2").build();
The following convenience methods are provided in the builder class for specifying SSL parameters:
- {@link oajrc.RestClientBuilder}
- {@link oajrc.RestClientBuilder#sslProtocols(String...) sslProtocols(String...)}
- {@link oajrc.RestClientBuilder#cipherSuites(String...) cipherSuites(String...)}
- {@link oajrc.RestClientBuilder#hostnameVerifier(HostnameVerifier) hostnameVerifier(HostnameVerifier)}
- {@link oajrc.RestClientBuilder#keyManagers(KeyManager...) keyManagers(KeyManager...)}
- {@link oajrc.RestClientBuilder#trustManagers(TrustManager...)}
- {@link oajrc.RestClientBuilder#secureRandom(SecureRandom)}
SSL support can also be enabled by passing in your own connection manager using {@link oajrc.RestClientBuilder#httpClientConnectionManager(HttpClientConnectionManager)}.