Keycloak SSL setup using docker image

前端 未结 3 1446
情歌与酒
情歌与酒 2020-12-29 13:49

I am trying to deploy keycloak using docker image (https://hub.docker.com/r/jboss/keycloak/ version 4.5.0-Final) and facing an issue with setting up SSL.

According t

3条回答
  •  抹茶落季
    2020-12-29 14:28

    After some research the following method worked (for self-signed certs, I still have to figure out how to do with letsencrypt CA for prod)

    generate a self-signed cert using the keytool

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

    convert .jks to .p12

    keytool -importkeystore -srckeystore keycloak.jks -destkeystore keycloak.p12 -deststoretype PKCS12
    

    generate .crt from .p12 keystore

    openssl pkcs12 -in keycloak.p12 -nokeys -out tls.crt
    

    generate .key from .p12 keystore

    openssl pkcs12 -in keycloak.p12 -nocerts -nodes -out tls.key
    

    Then use the tls.crt and tls.key for volume mount /etc/x509/https

    Also, on the securing app, in the keycloak.json file specify the following properties

    "truststore" : "path/to/keycloak.jks",
    "truststore-password" : "",
    

提交回复
热议问题