Example usage for io.vertx.core.http ClientAuth NONE

List of usage examples for io.vertx.core.http ClientAuth NONE

Introduction

In this page you can find the example usage for io.vertx.core.http ClientAuth NONE.

Prototype

ClientAuth NONE

To view the source code for io.vertx.core.http ClientAuth NONE.

Click Source Link

Document

No client authentication is requested or required.

Usage

From source file:spring.vertxtest.Application.java

@PostConstruct
public void init() {
    log.info("init() -- Initializing application");

    try {//  w ww  .  ja  v a2s  .  c o  m

        String httpPort = System.getProperty("HTTP_PORT", "54322");
        port = Integer.parseInt(httpPort);

        //Verticle port and router config
        verticle.setPort(port);
        Router router = Router.router(Vertx.vertx());
        verticle.setRouter(router);

        //Verticle ssl https config
        JksOptions keyStoreOptions = new JksOptions();
        keyStoreOptions.setPath(sslKeystorePath).setPassword(sslKeystorePassword);

        JksOptions trustStoreOptions = new JksOptions();
        trustStoreOptions.setPath(sslTruststorePath).setPassword(sslTruststorePassword);

        VertxOptions options = new VertxOptions();

        if (sslEnabled) {
            options.setEventBusOptions(new EventBusOptions().setSsl(true).setKeyStoreOptions(keyStoreOptions)
                    .setTrustStoreOptions(trustStoreOptions).setClientAuth(ClientAuth.NONE)
            //.setClientAuth(ClientAuth.REQUIRED)
            );
        }

        verticle.setSslOptions(keyStoreOptions, trustStoreOptions);

        //Launch verticle
        Vertx.vertx(options).deployVerticle(verticle);
    } catch (Exception e) {
        log.error("Exception", e);
    }
}