Skip to content

Redirect HTTP to HTTPS? #4354

Answered by danielkec
benbrim4 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi sorry for the late response, how about this?:

        int tlsPort = 4443;
        int plainPort = 8080;

        WebServer.builder()
                .port(tlsPort)
                .defaultSocket(s -> s
                        .tls(WebServerTls.builder()
                                     .privateKey(KeyConfig.keystoreBuilder()
                                                         .keystore(Resource.create("ssl/certificate.p12"))
                                                         .keystorePassphrase("helidon".toCharArray())
                                                         .build())
                                     .build()))
                .routing(r -> r.get("/t…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by romain-grecourt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants