I was just playing with some settings to find how to inject this parameters:
ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
Basically, we need to add this in databaseUrl, but in my spring roo app, it doesnt allow me to do it..
But there is another property named connectionProperties
inside org.apache.commons.dbcp.BasicDataSource
bean in appcontext.xml .
applicationContext.xml:
<bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource">
<property name="driverClassName" value="${database.driverClassName}"/>
<property name="url" value="${database.url}"/>
<property name="username" value="${database.username}"/>
<property name="password" value="${database.password}"/>
<property name="connectionProperties" value="ssl=true;sslfactory=org.postgresql.ssl.NonValidatingFactory"></property>
Its working but there is one problem, When i run my app, It takes minimum 5 minutes to startup! So i needed to increase my tomcat's timeout setting. Hope this helps someone! Cheers:)