title: Tomcat JDBCRealm using Oracle database over SSL (PROTOCOL=TCPS)
body: <p>I'm trying to implement JDBCRealm in tomcat (as described in <a href="http://tomcat.apache.org/tomcat-4.1-doc/realm-howto.html#Configuring%20a%20Realm" rel="nofollow">http://tomcat.apache.org/tomcat-4.1-doc/realm-howto.html#Configuring%20a%20Realm</a>) to check credential agains Oracle Database. The thing is that I want database to communicate over SSL. So I configured listener to use TCPS. Like that:</p>
  
  <pre><code>  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=&lt;hostname&gt;)(PORT=1521)))&lt;br&gt;
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=&lt;hostname&gt;)(PORT=1512)))
  </code></pre>
  
  <p>Generated certificates, etc. I have no problem connecting to database using tcps from sqlplus or from WLS (I can use connection property <code>oracle.net.ssl_cipher_suites=(SSL_DH_anon_WITH_3DES_EDE_CBC_SHA,SSL_DH_anon_WITH_RC4_128_MD5,SSL_DH_anon_WITH_DES_CBC_SHA)</code> there without any problem).</p>
  
  <p>However, I cant get JDBCRealm to work with the database over TCPS. If I configure realm like this:<br>
  <code>&lt;Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" driverName="oracle.jdbc.driver.OracleDriver" connectionURL="jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCPS)(HOST = &lt;hostname&gt;)(PORT = 1512)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = &lt;service name&gt;)))" connectionName="&lt;login&gt;" connectionPassword="&lt;password&gt;" userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name" /&gt;</code><br>
  I'm getting following error:<br></p>
  
  <pre><code>javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  </code></pre>
  
  <p>I imported certificates in JKS store which I configured in Tomcat like this:</p>
  
  <p></p>
  
  <p>With no success.</p>
  
  <p>I'm not a professional in Tomcat (more in databases). I'll appreciate any help or pointing me in right direction. Thanks in advance!</p>