Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save javaeeeee/8fea2304b481fbcc4f5b to your computer and use it in GitHub Desktop.

Select an option

Save javaeeeee/8fea2304b481fbcc4f5b to your computer and use it in GitHub Desktop.
Dropwizard Integration Test using HTTPS/TLS and Jersey 2.x Client
//Create SSL Configurator
SslConfigurator sslConfigurator = SslConfigurator.newInstance();
//Register a keystore
sslConfigurator.trustStoreFile("dwstart.keystore")
.trustStorePassword("crimson");
//Create SSL Context
SSLContext sSLContext = sslConfigurator.createSSLContext();
//Obtain client
Client client = ClientBuilder
.newBuilder()
.sslContext(sSLContext)
.build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment