-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
Copy pathServer.java
33 lines (26 loc) · 915 Bytes
/
Server.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package io.vertx.example.webclient.https;
import io.vertx.core.Future;
import io.vertx.core.VerticleBase;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.core.net.JksOptions;
import io.vertx.launcher.application.VertxApplication;
/*
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a>
*/
public class Server extends VerticleBase {
public static void main(String[] args) {
VertxApplication.main(new String[]{Server.class.getName()});
System.out.println("Server started");
}
@Override
public Future<?> start() throws Exception {
// Start an SSL/TLS http server
return vertx.createHttpServer(new HttpServerOptions().setKeyCertOptions(new JksOptions()
.setPath("io/vertx/example/webclient/https/server-keystore.jks")
.setPassword("wibble"))
.setSsl(true)
).requestHandler(req -> {
req.response().end();
}).listen(8443);
}
}