Auto DevOps Postgres Database SSL Error


#1

I enabled Auto DevOps on my repo which contains a Spring Boot app.

Part of the Test stage of the Pipeline spawns up a Postgres database which is nice, but I get the following error:
org.postgresql.util.PSQLException: The server does not support SSL.

I altered both SPRING_DATASOURCE_URL and JDBC_DATABASE_URL as Secret Variables in CI/CD settings to change &sslmode=require to &sslmode=disable on both URLs. SPRING_DATA_SOURCE reflects the secret variable change and this seems to solve the problem, but it’s noteworthy that JDBC_DATABASE_URL is not overridden.

Why does it spawn up an image with Postgres that doesn’t support SSL but enforces it as a URL parameter? Or am I doing something very wrong?


#2

I got the same problem using Auto DevOps and Spring Boot with an H2 in-memory-database.

I believe this should not happen in the automatic config - Any news on it?


#3

I have a feeling this is because the JVM build pack overrides it. On Heroku this should always be an SSL connection hence the build pack enforces it. You could clone the build pack change the line in the following link:

Then set this as your default build pack.


#4

Hi @brandonscott, using the suggestion from @mackstar, I create this custom buildpack.
https://github.com/krlsdu/heroku-buildpack-java
and
https://github.com/krlsdu/heroku-buildpack-jvm-common

and update on gitlabci the variable

BUILDPACK_URL=https://github.com/krlsdu/heroku-buildpack-java.git

Obs.: This repository is designed for experimentation and will not be updated.