Created
December 12, 2017 16:50
-
-
Save alexcheng1982/a3ec57b20f393874b005fce6bc194f4e to your computer and use it in GitHub Desktop.
Jetty Https Connector
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
final SslContextFactory sslContextFactory = new SslContextFactory(keyStorePath); | |
sslContextFactory.setKeyStorePassword(keyStorePassword); | |
final HttpConfiguration httpsConfiguration = new HttpConfiguration(httpConfiguration); | |
httpsConfiguration.addCustomizer(new SecureRequestCustomizer()); | |
final ServerConnector httpsConnector = new ServerConnector(server, | |
new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), | |
new HttpConnectionFactory(httpsConfiguration)); | |
httpsConnector.setPort(httpsPort); | |
server.addConnector(httpsConnector); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment