Keycloak 19 KC_HTTPS_KEY_STORE_FILE not working on windows host

Hi i’m trying to run keycloak 19 on docker over https and http in dev mode using keystore but it doesn’t work.
I’m working on windows 10.

here’s the commands

//psck12 password

docker run -p 8080:8080 -p 8443:8443 -e KC_DB=mysql -e JDBC_PARAMS="useSSL=false" -e KC_DB_URL=jdbc:mysql://host.docker.internal:3306/keycloak -e KC_DB_USERNAME=keycloak -e KC_DB_PASSWORD=keycloak \
	-e KC_HTTP_ENABLED=true \
	-e KC_HTTPS_KEY_STORE_FILE="keycloak.p12" \
	-e KC_HTTPS_KEY_STORE_PASSWORD="password" \
	--name=keycloak quay.io/keycloak/keycloak:19.0.1 start-dev

//jks password

docker run -p 8080:8080 -p 8443:8443 -e KC_DB=mysql -e JDBC_PARAMS="useSSL=false" -e KC_DB_URL=jdbc:mysql://host.docker.internal:3306/keycloak -e KC_DB_USERNAME=keycloak -e KC_DB_PASSWORD=keycloak \
	-e KC_HTTP_ENABLED=true \
	-e KC_HTTPS_KEY_STORE_FILE=keycloak.jks \
	-e KC_HTTPS_KEY_STORE_PASSWORD=password \
	--name=keycloak quay.io/keycloak/keycloak:19.0.1 start-dev

for both command i get the same error

2022-08-23 07:12:24,642 INFO [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000128: Infinispan version: Infinispan ‘Triskaidekaphobia’ 13.0.9.Final
2022-08-23 07:12:24,923 INFO [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (main) Node name: node_574773, Site name: null
2022-08-23 07:12:25,607 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (development) mode
2022-08-23 07:12:25,607 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: keycloak.jks

The error doesn’t says anything
I’ve generated the jks file with the commande

 keytool -genkey -alias localhost -keyalg RSA -keystore keycloak.jks -validity 10950

from HTTPS/SSL Setup | keycloak-documentation

I have tried thoses commands with keycloak 18.0.2 and I got the same results
I have tried to fill KC_HTTPS_KEY_STORE_FILE with full path, relative path and file name when i’m running the command from the file directory. Each time I got the exact same error. Please what did i do wrong ?

Hello,

I had a issue like this when I was making certs for LDAPS, I had to convert my certificates from Keycloak to allow Windows Server to read them.