I am new to Helidon, and we want our Java app to support HTTPS for REST calls. I have a sample controller that returns some string, and my app currently runs on http://localhost:8080. How can I enable HTTPS and configure SSL?
Sample controller:
@Path("/test")
@ApplicationScoped
public class TestEndpointController {
@GET
public Response executeRule() {
return Response.status(200).entity("Working").build();
}
}
Here's what I tried: Generated self signed certificate and configured it in the application.yaml file:
server:
port: 8080
host: 0.0.0.0
ssl:
private-key:
keystore-resource-path: "keystore.p12"
keystore-passphrase: "changeit"
experimental:
http2:
enable: true
max-content-length: 16384
Command used to generate cert keytool -genkeypair -alias localhost -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore keystore.p12 -validity 365
But when I try to hit the endpoint with https I am getting below error This site can’t provide a secure connection
http2
is no longer "experimental" in Helidon).