You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: java.lang.IllegalArgumentException: sslRootCert must not be null and must exist
at io.r2dbc.postgresql.util.Assert.requireFileExistsOrNull(Assert.java:131) ~[r2dbc-postgresql-0.8.4.RELEASE.jar:0.8.4.RELEASE]
at io.r2dbc.postgresql.PostgresqlConnectionConfiguration$Builder.sslRootCert(PostgresqlConnectionConfiguration.java:641) ~[r2dbc-postgresql-0.8.4.RELEASE.jar:0.8.4.RELEASE]
Workaround for running unjarred via Spring is to do the classpath lookup manually like this:
fun main() {
val certFile = File(Application::class.java.classLoader.getResource("cert.pem")!!.toURI())
System.setProperty("spring.r2dbc.properties.sslRootCert", certFile.path)
runApplication<Application>()
}
I have not yet found a workaround to have the file loaded from within the jar.
I am unsure whether this should be addressed here or directly in r2dbc though.
The text was updated successfully, but these errors were encountered:
The Postgres expects that files are loaded externally. This issue tracker is used for Spring Data R2DBC matters. Since the SSL certificate and other options are passed as Map<String, String>, there isn't much we can do here. Can you file a ticket in r2dbc-postgres to ask for supporting URL-based coordinates for SSL certificates? It would also make sense to raise a ticket in Spring Boot to explain your case and discuss options.
I have a
cert.pem
in mysrc/main/resources
I need it when running the app jarred as well as unjarred.
Specifying it faithfully in my
application.properties
asspring.r2dbc.properties.sslRootCert=classpath:cert.pem
fails as r2dbc does not load the file via classpath: https://github.com/pgjdbc/r2dbc-postgresql/blob/main/src/main/java/io/r2dbc/postgresql/util/Assert.java#L130Workaround for running unjarred via Spring is to do the classpath lookup manually like this:
I have not yet found a workaround to have the file loaded from within the jar.
I am unsure whether this should be addressed here or directly in r2dbc though.
The text was updated successfully, but these errors were encountered: