Hi,
further to my earlier post, I downloaded the source to my driver located at:

http://jdbc.postgresql.org/download.html

the source in question being pg80b1.308.src.tar.gz

located within /doc/pgjdbc.xml I came across the following snippet which 
backsup earlier comment about using postgres-ds.xml to specify the location of 
the trustStore:


  |     <para>
  |      In addition to the standard connection parameters the driver supports a
  |      number of additional properties which can be used to specify additional
  |      driver behavior specific to <productname>PostgreSQL</productname>.  
These
  |      properties may be specified in either the connection
  |      <acronym>URL</acronym> or an additional
  |      <classname>Properties</classname> object parameter to
  |      <function>DriverManager.getConnection</function>.  The following
  |      examples illustrate the use of both methods to establish a SSL
  |      connection.
  | 
  | <programlisting>
  | String url = "jdbc:postgresql://localhost/test";
  | Properties props = new Properties();
  | props.setProperty("user","fred");
  | props.setProperty("password","secret");
  | props.setProperty("ssl","true");
  | Connection conn = DriverManager.getConnection(url, props);
  | </programlisting>
  | 

So, refering back to my postgres-ds.xml file for a second while keeping the 
above in mind:


  | <datasources>
  |   <local-tx-datasource>
  |     <jndi-name>PostgresDS</jndi-name>
  |     
<connection-url>jdbc:postgresql://localhost:5432/beyarecords?ssl=true</connection-url>
  |     <driver-class>org.postgresql.Driver</driver-class>
  |     <user-name>postgres</user-name>
  |     <password>postgres</password>
  |     <max-pool-size>10</max-pool-size>
  | 
  |       <metadata>
  |          <type-mapping>PostgreSQL 7.2</type-mapping>
  |       </metadata>
  |   </local-tx-datasource>
  | </datasources>
  | 

I need to add the additional parameters:

System.setProperty("javax.net.ssl.trustStore", cacert);
System.setProperty("javax.net.ssl.trustStorePassword","changeit");

which in my postgres-ds.xml would be represented as:


  | 
<javax.net.ssl.trustStore>/library/java/home/lib/security/cacert</javax.net.ssl.trustStore>
  | 
<javax.net.ssl.trustStorePassword>changeit</javax.net.ssl.trustStorePassword>
  | 

or something like that. can this be done?

many thanks

Andrew

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3857734#3857734

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3857734


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to