Created
February 10, 2015 04:07
-
-
Save javaeeeee/8fea2304b481fbcc4f5b to your computer and use it in GitHub Desktop.
Dropwizard Integration Test using HTTPS/TLS and Jersey 2.x Client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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