Created
March 7, 2019 12:54
-
-
Save hofiorg/f76561667ef9dde37483ed8ed58c5d93 to your computer and use it in GitHub Desktop.
SSL Configuration for Vert.x HttpServer
This file contains 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
private HttpServer sslConfiguration() { | |
Boolean ssl = config().getBoolean(CONFIG_SSL, DEFAULT_SSL); | |
logger.debug(CONFIG_SSL + " " + ssl); | |
if(ssl) { | |
String keystoreFile = config().getString(CONFIG_SSL_KEYSTORE_FILE, DEFAULT_SSL_KEYSTORE_FILE); | |
logger.debug(CONFIG_SSL_KEYSTORE_FILE + " " + keystoreFile); | |
String keystorePassword = config().getString(CONFIG_SSL_KEYSTORE_PASSWORD, DEFAULT_SSL_KEYSTORE_PASSWORD); | |
logger.debug(CONFIG_SSL_KEYSTORE_PASSWORD + " " + keystorePassword); | |
HttpServerOptions options = new HttpServerOptions() | |
//.setUseAlpn(true) | |
.setSsl(true) | |
.setKeyStoreOptions(new JksOptions() | |
.setPath(keystoreFile) | |
.setPassword(keystorePassword)); | |
return vertx.createHttpServer(options); | |
} | |
return vertx.createHttpServer(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment