How to enable JBoss 4.2 to connect to a SSL enabled DATABASE

There may be a chance when you need to make your database to accept only SSL connections. In that case what you have to do is to put the appropriate datasource file into the deploy folder of your database. The point to make sure here is that mention the url in the database for ssl and not for simple.


I used JBoss-eap-as 4.2 and Postgres8.1


Copy the datasource file from


jboss-eap-4.2\jboss-as\docs\examples\jca


Or in you case it could be

jboss-as\docs\examples\jca


Into the deploy folder of your configuration.


jboss-eap-4.2\jboss-as\server\default\deploy


or


jboss4.x\server\default\deploy


Provide the connection url, username and password :


In case of postgres url is :


jdbc:postgresql://ipaddress:5432/databasename?ssl=true&a m p;


sslfactory=org.postgresql.ssl.NonValidatingFactory&a m p; “


NOTE : DONT GIVE SPACE IN &a m p; OTHERWISE IT WILL NOT WORK, i HAVE TO DO THIS OTHER IT WILL NOT HAVE APPEARED IN THIS BLOG. THANX


Remember in this case there is no client-side authentication. In case you want to have a client-side authentication then you need to have a digital Certificate given by a certifying authority or you can either generate one for your self ( I have explained about how to generate a keystore in my previous post http://ravishbhupesh.wordpress.com/2008/05/06/enabling-ssl-on-jboss-2/ ).


More Here


Courtesy:http://ravishbhupesh.wordpress.com/2008/05/06/connect-to-ssl-enabled-database-via-jboss/