0

Following to my previous post : GeoNetwork 4.2.1 (Debian) install : error message?

The problem seems to come from the JDBC driver wants to connect over SSL. Do you know why JDBC driver wants by default to connect over SSL? With GeoNetwork, is it mandatory to use SSL protocol? It would be possible to disable SSL connection attempt? I would prefer to try disable SSL connection attempt via GeoNetwork config files rather than to enable/set a SSL configuration (like set a certificate for instance) on the PostgreSQL/PostGIS db. For information, I succeed in connecting to my PostGIS db via psql console. Below the jdbc.properties at jdbc.connectionProperties is on ssl=false

jdbc.connectionProperties=ssl=false
jdbc.basic.removeAbandoned=true
jdbc.basic.removeAbandonedTimeout=300
jdbc.basic.logAbandoned=true
jdbc.basic.maxActive=30
jdbc.basic.maxIdle=10
jdbc.basic.initialSize=10
jdbc.basic.maxWait=500
jdbc.basic.testOnBorrow=true
jdbc.basic.timeBetweenEvictionRunsMillis=1000
jdbc.basic.minEvictableIdleTimeMillis=1800000
jdbc.basic.testWhileIdle=true
jdbc.basic.numTestsPerEvictionRun=5
jdbc.basic.poolPreparedStatements=true
jdbc.basic.maxOpenPreparedStatements=1200
jdbc.basic.validationQuery=SELECT 1
jdbc.basic.defaultReadOnly=false
jdbc.basic.defaultAutoCommit=false

For information, below, the GeoNetwork logs generated when I try to start GeoNetwork :

2022-12-08T11:46:03,644 WARN  [geonetwork.databasemigration] -   - Migration: Exception running migration for version: 4.2.1-0 subversion: SNAPSHOT. Cannot create PoolableConnectionFactory (SSL error: Connection reset) 2022-12-08T11:46:03,663 ERROR [jeeves] - JeevesContextLoaderListener: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/var/lib/tomcat9/webapps/geonetwork/WEB-INF/lib/gn-domain-4.2.1-0.jar!/config-spring-geonetwork.xml]: Cannot resolve reference to bean 'jdbcDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbcDataSource' defined in URL [file:/var/lib/tomcat9/webapps/geonetwork/WEB-INF/config-db/defaultJdbcDataSource.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.sql.SQLException: Cannot create PoolableConnectionFactory (SSL error: Connection reset) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/var/lib/tomcat9/webapps/geonetwork/WEB-INF/lib/gn-domain-4.2.1-0.jar!/config-spring-geonetwork.xml]: Cannot resolve reference to bean 'jdbcDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbcDataSource' defined in URL [file:/var/lib/tomcat9/webapps/geonetwork/WEB-INF/config-db/defaultJdbcDataSource.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.sql.SQLException: Cannot create PoolableConnectionFactory (SSL error: Connection reset)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbcDataSource' defined in URL [file:/var/lib/tomcat9/webapps/geonetwork/WEB-INF/config-db/defaultJdbcDataSource.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.sql.SQLException: Cannot create PoolableConnectionFactory (SSL error: Connection reset)

2022-12-08T11:46:03,689 FATAL [jeeves.engine] - Raised exception during init 2022-12-08T11:46:03,689 FATAL [jeeves.engine] -    Exception : org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/var/lib/tomcat9/webapps/geonetwork/WEB-INF/lib/gn-domain-4.2.1-0.jar!/config-spring-geonetwork.xml]: Cannot resolve reference to bean 'jdbcDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbcDataSource' defined in URL [file:/var/lib/tomcat9/webapps/geonetwork/WEB-INF/config-db/defaultJdbcDataSource.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.sql.SQLException: Cannot create PoolableConnectionFactory (SSL error: Connection reset)
2022-12-08T11:46:03,689 FATAL [jeeves.engine] -    Message   : Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/var/lib/tomcat9/webapps/geonetwork/WEB-INF/lib/gn-domain-4.2.1-0.jar!/config-spring-geonetwork.xml]: Cannot resolve reference to bean 'jdbcDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbcDataSource' defined in URL [file:/var/lib/tomcat9/webapps/geonetwork/WEB-INF/config-db/defaultJdbcDataSource.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.sql.SQLException: Cannot create PoolableConnectionFactory (SSL error: Connection reset) 2022-12-08T11:46:03,693 FATAL [jeeves.engine] -    Stack     : org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/var/lib/tomcat9/webapps/geonetwork/WEB-INF/lib/gn-domain-4.2.1-0.jar!/config-spring-geonetwork.xml]: Cannot resolve reference to bean 'jdbcDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbcDataSource' defined in URL [file:/var/lib/tomcat9/webapps/geonetwork/WEB-INF/config-db/defaultJdbcDataSource.xml]: Initialization of bean failed; nested exception is java.lang.RuntimeException: java.sql.SQLException: Cannot create PoolableConnectionFactory (SSL error: Connection reset)

1 Answer 1

1

GeoNetwork doesn't require a SSL certificate for connecting to Postgres. It's probably the Postgres server the one requiring connection with SSL to allow to connect to it. Check the details about SSL in Postgres in their documentation.

Your problem could be related to not having the PostgreSQL certificate's CA added to the the Java trusted stored used by GeoNetwork. For adding the CA certificate to the JVM trustedstore you can run this command (default password is changeit):

$JRE_HOME/bin/keytool -import -file cert.cer -alias myca -keystore $JRE_HOME/lib/security/cacerts

Check more details about SSL in the Postgres JDBC driver documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.