Open hendrik-weiler opened 10 hours ago
You have used an alias, you need to configure it:
server:
port: 8080
host: 0.0.0.0
tls:
enabled: true
private-key:
keystore:
type: "JKS"
passphrase: "changeit"
key.alias: "localhost"
resource:
path: "keystore.jks"
Thank you. It works now. This is my new application.yaml:
server:
port: 8443
host: 0.0.0.0
tls:
enabled: true
private-key:
keystore:
type: "JKS"
passphrase: "changeit"
key.alias: "localhost"
resource:
path: "src/main/resources/keystore.jks"
truststore:
type: "JKS"
passphrase: "changeit"
key.alias: "localhost"
resource:
path: "src/main/resources/keystore.jks"
The new script for generating the self signed certificate:
#!/bin/zsh
keytool -genkeypair -alias localhost -keyalg RSA -keysize 2048 -validity 365 -dname "CN=localhost" -keypass changeit -keystore keystore.jks -storepass changeit
keytool -export -alias localhost -keystore keystore.jks -rfc -file localhost.cer
keytool -import -alias localhost -file localhost.cer -keystore truststore
keytool -import -file localhost.cer -alias localhost -keystore keystore.jks
I get the following error now: ´´` javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown ´´´
Is it possible to somehow register the certificate that i get no Browser message that the certificate is invalid? I have found something with cacerts and this script https://raw.githubusercontent.com/joshcalafell/SSLKeytool/refs/heads/master/SSLKeyTool.sh when i try to add the certificate to the cacerts file but it needs a password. I have read that it was changeit but that doenst work.
Environment Details
Problem Description
I create a basic project using mvn with this guide https://helidon.io/docs/v4/se/guides/quickstart and i create a jks certificate for using https in localhost.
Here is my resources/application.yaml:
I create the jks with the following command:
keytool -genkeypair -alias localhost -keyalg RSA -keysize 2048 -validity 365 -dname "CN=localhost" -keypass changeit -keystore keystore.jks -storepass changeit
I run the application using this command:
I get the following error in the browser: ERR_SSL_PROTOCOL_ERROR and in the log i get following error:
Steps to reproduce