openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: Oracle DB authentication with SSL certificate
Date Tue, 08 May 2012 13:12:53 GMT
Martin -

I haven't tried this, but take a look at openjpa.ConnectionProperties[1][2].

Thanks,
Rick

[1]
http://openjpa.apache.org/builds/latest/docs/docbook/manual.html#openjpa.ConnectionProperties
[2]
http://openjpa.apache.org/builds/latest/docs/docbook/manual.html#ref_guide_dbsetup_config

On Tue, May 8, 2012 at 4:09 AM, Martin Weiss <martin.weiss@credit-suisse.com
> wrote:

> Hi all,
> I can connect to Oracle DB with an SSL certificate via JDBC (see code
> snippet below). However, I have problems to connect with OpenJPA. Any hints
> and tips are appreciated.
> Regards,
> Martin
>
>
> try {
>   Connection conn = null;
>   FileInputStream pin = new FileInputStream(
>      "/home/iopapp/java/dbconnection_properties");
>   Properties cnxProp = new Properties();
>   cnxProp.load(pin);
>   String url = cnxProp.getProperty("url");
>   cnxProp.remove("url");
>   OracleDataSource ods = new OracleDataSource();
>   ods.setURL(url);
>   ods.setConnectionProperties(cnxProp);
>   conn = ods.getConnection();
> } catch (Exception exception) {
>   exception.printStackTrace();
> }
>
> file /home/iopapp/java/dbconnection_properties:
>
> url=url=jdbc:oracle:thin:@DZHLOD2003-scan.ch.hedani.net:1523:DZHIOP10
> javax.net.ssl.keyStore=/opt/pki/etc/spid_S107973_T.keystore.properties
> javax.net.ssl.trustStore=/opt/pki/etc/tca/trusted_ca_cs.properties
> javax.net.ssl.trustStoreType=CS_PKI
> javax.net.ssl.keyStoreType=CS_PKI
> javax.net.ssl.trustStorePassword=not_used
> javax.net.ssl.keyStorePassword=not_used
> oracle.net.authentication_services=(TCPS)
> oracle.net.ssl_client_authentication=TRUE
> oracle.net.ssl_cipher_suites=(TLS_RSA_WITH_AES_256_CBC_SHA)
> ssl.keyManagerFactory.algorithm=SunX509
>
> --
>



-- 
*Rick Curtis*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message