Configuring Connections Under The Ibm Data Server Driver For Jdbc And Sqlj To Use Ssl; Configuring The Java Runtime Environment To Use Ssl - IBM DB2 Manual

Table of Contents

Advertisement

|
|
|
|
Configuring connections under the IBM Data Server Driver for
|
JDBC and SQLJ to use SSL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

Configuring the Java Runtime Environment to use SSL

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"Creating and deploying DataSource objects" on page 19
Related reference
"Properties for the IBM Data Server Driver for JDBC and SQLJ" on page 201
"Configuring the DB2 server for SSL" (DB2 Administration Guide)
To configure database connections under the IBM Data Server Driver for JDBC and
SQLJ to use SSL, you need to set the DB2BaseDataSource.sslConnection property to
true.
Prerequisite: Before a connection to a data source can use SSL, the port to which
the application connects must be configured in the database server as the SSL
listener port.
1. Set DB2BaseDataSource.sslConnection on a Connection or DataSource instance.
2. Optional: Set DB2BaseDataSource.sslTrustStoreLocation on a Connection or
DataSource instance. Setting the sslTrustStoreLocation property is an alternative
to setting the Java javax.net.ssl.trustStore property. If you set
DB2BaseDataSource.sslTrustStoreLocation, javax.net.ssl.trustStore is not
used.
3. Optional: Set DB2BaseDataSource.sslTrustStorePassword on a Connection or
DataSource instance. Setting the sslTrustStorePassword property is an
alternative to setting the Java javax.net.ssl.trustStorePassword property. If
you set DB2BaseDataSource.sslTrustStorePassword,
javax.net.ssl.trustStorePassword is not used.
The following example demonstrates how to set the sslConnection property on a
Connection instance:
java.util.Properties properties = new java.util.Properties();
properties.put("user", "xxxx");
properties.put("password", "yyyy");
properties.put("sslConnection", "true");
java.sql.Connection con =
java.sql.DriverManager.getConnection(url, properties);
Before you can use Secure Sockets Layer (SSL) connections in your JDBC and SQLJ
applications, you need to configure the Java Runtime Environment to use SSL.
Before you can configure your Java Runtime Environment for SSL, you need to
satisfy the following prerequisites:
v The Java Runtime Environment must include a Java security provider. The IBM
JSSE provider or the Sun JSSE provider must be installed. The IBM JSSE
provider is automatically installed with the IBM SDK for Java.
Restriction: You can only use the Sun JSSE provider only with a Sun Java
Runtime Environment. The Sun JSSE provider does not work with an IBM Java
Runtime Environment.
v SSL support must be configured on the database server.
To configure your Java Runtime Environment to use SSL, follow these steps.
1. Import a certificate from the database server to a Java truststore on the client.
Use the Java keytool utility to import the certificate into the truststore.
Chapter 10. Security under the IBM Data Server Driver for JDBC and SQLJ
459

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents