Hi all ,
While running OpenMRS 2.6.x (using Bahmni image) on Kubernetes with the oauth2login module and Keycloak. Locally via Docker Compose, everything works perfectly using plain HTTP. However, in our Kubernetes cluster, the OpenMRS container immediately exits at startup. The issue occurs because our OAuth2 browser URL uses HTTPS with a certificate issued by an internal CA.
Local Environment (Works) No TLS involved. Both sides use HTTP:
OAUTH2_INTERNAL_URL=http://keycloak:8080
OAUTH2_BROWSER_URL=http://localhoost
Kubernetes Environment (Fails) Browsers must reach Keycloak at the public HTTPS host, so OAUTH2_BROWSER_URLmust use the external domain:
OAUTH2_BROWSER_URL=https://auth.example.com
OAUTH2_BASE_URL=http://keycloak-internal-service:8080
failure path :
- The image’s
startup.shscript runs . - It starts Tomcat in the background and then runs a warm-up check:
curl -sL ``http://localhost:8080/openmrs/. - Because OAuth2 is enabled,
/openmrs/immediately redirects to[``https://auth.example.com/``](``https://auth.example.com/``).... - curl to follow sthe redirect to the HTTPS external URL.
- And fails because it doesn’t trust the internal CA .
- the curl failure (
exit 7) aborts the entire script, causing the container to exit.
What is the actual purpose of this curl warm-up check during container initialization? Is it strictly necessary for OpenMRS startup, and what would be the potential impact of bypassing or modifying this check?
Is there a built-in environment variable or configuration to bypass this specific curl warm-up check in the OpenMRS startup script? Alternatively, if the check cannot be bypassed, is the recommended approach to mount our internal CA certificate into /etc/pki/tls/certs/ inside the container before the script runs, or is there a cleaner way to handle OAuth2 redirects during container initialization?
Thanks! @ibacher @mseaton @mksd @angshuonline