简体   繁体   English

在 openshift 上为 keycloak 配置 TLS

[英]Configure TLS for keycloak on openshift

I want to configure SSL on keycloak deployment on openshift.我想在 openshift 上的 keycloak 部署中配置 SSL。 I am using jboss/keycloak image for keycloak deployment which used latest keycloak version 4.6.final.我正在使用jboss/keycloak映像进行 keycloak 部署,它使用了最新的 keycloak 版本 4.6.final。 But I read it somewhere that keycloak doesn't accept default TLS certificates available on openshift.但我在某处读到 keycloak 不接受 openshift 上可用的默认 TLS 证书。

My purpose is to run the keycloak application on https on openshift.我的目的是在 openshift 上的 https 上运行 keycloak 应用程序。 It works fine on http, but when I create the route with TLS enabled, it fails to run.它在 http 上运行良好,但是当我创建启用了 TLS 的路由时,它无法运行。 I think I am missing some parameter somewhere in the deployment config.我想我在部署配置的某处遗漏了一些参数。

You must configure in Openshift a route with reencrypt termination.您必须在 Openshift 中配置带有重新加密终止的路由。 In my case that was solving the problem.就我而言,这正在解决问题。

You have from your frontend tot openshift router ssl en ssl from your router to your backend pod.您从前端到 openshift 路由器 ssl 和 ssl 从路由器到后端 pod。 That requires reencrypt termination.这需要重新加密终止。

In your route you have to define 4 certificates在您的路线中,您必须定义 4 个证书

tls certificate tls key ca certificate (your intermediate certificate) destination certifcate (the certificate you use on the keycloak pod) tls 证书 tls key ca 证书(您的中间证书)目标证书(您在 keycloak pod 上使用的证书)

For the desination certifcate I have used the certificate in my alpine pod in /etc/ssl/certs (ca-certifcates.crt)对于目的地证书,我在 /etc/ssl/certs (ca-certifcates.crt) 中的 alpine pod 中使用了证书

More about reencrypt termination: https://docs.openshift.com/container-platform/4.7/networking/routes/secured-routes.html有关重新加密终止的更多信息: https://docs.openshift.com/container-platform/4.7/networking/routes/secured-routes.html

In order to configure route with reencrypt termination:为了配置带有重新加密终止的路由:

oc create route reencrypt <NAME> --service=keycloak --port=keycloak --cert=<CERTIFICATEFILE>.crt --key=<KEYFILE>.key --hostname=sso.apps.company.lan

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM