Skip to content

Instantly share code, notes, and snippets.

@ThatJoeMoore
Created September 15, 2015 16:20
Show Gist options
  • Save ThatJoeMoore/5143b5456833c2a39ed1 to your computer and use it in GitHub Desktop.
Save ThatJoeMoore/5143b5456833c2a39ed1 to your computer and use it in GitHub Desktop.
SSLContext sslContext = SSLContexts.custom()
.useProtocol("TLS")
.loadTrustMaterial(new File("/etc/something"), "password".toCharArray())
.build();
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext);
HttpClient client = HttpClientBuilder.create()
.setSSLSocketFactory(sslsf)
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment