Datasource not responding using org.testcontainers:postgresql in 1.18.3 (works in 1.17.3)
              
              #7139
            
            
          -
| Hi, I'm starting up a Hikari datasource with a jdbc url of  With version 1.17.3 it works fine, but with 1.18.3 the container starts OK but the JVM can't connect to it - times out. Any ideas what's changed? Hikari startup: val dataSource = HikariDataSource().apply {
    this.jdbcUrl = "jdbc:tc:prebuiltdb:prebuilt_db:///test"
    this.username = "test"
    this.password = null
    maximumPoolSize = 15
    maxLifetime = Duration.ofMinutes(10).toMillis()
    keepaliveTime = Duration.ofMinutes(1).toMillis()
    this.connectionTimeout = Duration.ofMinutes(1).toMillis()
    initializationFailTimeout = -1 // decouple app startup from db being there
    isAutoCommit = true
    addDataSourceProperty("ssl", true)
    addDataSourceProperty("sslfactory", "org.postgresql.ssl.NonValidatingFactory")
    addDataSourceProperty("sslhostnameverifier", "org.apache.http.conn.ssl.NoopHostnameVerifier")
}Logs:  | 
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
| AFAIK, postgres default image doesn't bring ssl enabled and previous to 1.17.4 the properties in the datasource were ignored. See #5829 
 | 
Beta Was this translation helpful? Give feedback.
-
| Aagh! And I've actually been caught by that previously and had forgotten... thanks. | 
Beta Was this translation helpful? Give feedback.
AFAIK, postgres default image doesn't bring ssl enabled and previous to 1.17.4 the properties in the datasource were ignored. See #5829
addDataSourceProperty("ssl", true)is adding the property to the testcontainers connection string? If so, a quick test is settingsslto false and the proper one is to configure postgres image to require ssl