[root@number8 com.sonariov1]# cd /tmp/mysql-connector-java-5.1.5/src/com/mysql/jdbc/ cd /tmp/mysql-connector-java-5.1.5/src/com/mysql/jdbc/ [root@number8 jdbc]# ls *~ ls *~ ConnectionPropertiesImpl.java.~1~ LocalizedErrorMessages.properties.~1~ ExportControlled.java.~1~ [root@number8 jdbc]# diff -ur ConnectionPropertiesImpl.java.~1~ ConnectionPropertiesImpl.java diff -ur ConnectionPropertiesImpl.java.~1~ ConnectionPropertiesImpl.java --- ConnectionPropertiesImpl.java.~1~ 2007-10-05 12:08:45.000000000 -0700 +++ ConnectionPropertiesImpl.java 2007-10-27 00:31:43.000000000 -0700 @@ -1223,6 +1223,11 @@ Messages.getString("ConnectionProperties.requireSSL"), //$NON-NLS-1$ "3.1.0", SECURITY_CATEGORY, 3); //$NON-NLS-1$ + private BooleanConnectionProperty requireSSLcert = new BooleanConnectionProperty( + "requireSSLcert", true, + Messages.getString("ConnectionProperties.requireSSLcert"), + "5.1.5", SECURITY_CATEGORY, 3); + private StringConnectionProperty resourceId = new StringConnectionProperty( "resourceId", //$NON-NLS-1$ null, Messages.getString("ConnectionProperties.resourceId"), //$NON-NLS-1$ @@ -2301,6 +2306,12 @@ public boolean getRequireSSL() { return this.requireSSL.getValueAsBoolean(); } + /* (non-Javadoc) + * @see com.mysql.jdbc.IConnectionProperties#getRequireSSLcert() + */ + public boolean getRequireSSLcert() { + return this.requireSSLcert.getValueAsBoolean(); + } protected boolean getRetainStatementAfterResultSetClose() { return this.retainStatementAfterResultSetClose.getValueAsBoolean(); @@ -3226,6 +3237,13 @@ } /* (non-Javadoc) + * @see com.mysql.jdbc.IConnectionProperties#setRequireSSLcert(boolean) + */ + public void setRequireSSLcert(boolean property) { + this.requireSSLcert.setValue(property); + } + + /* (non-Javadoc) * @see com.mysql.jdbc.IConnectionProperties#setRetainStatementAfterResultSetClose(boolean) */ public void setRetainStatementAfterResultSetClose(boolean flag) { [root@number8 jdbc]# diff -ur LocalizedErrorMessages.properties.~1~ LocalizedErrorMessages.properties diff -ur LocalizedErrorMessages.properties.~1~ LocalizedErrorMessages.properties --- LocalizedErrorMessages.properties.~1~ 2007-10-05 12:08:47.000000000 -0700 +++ LocalizedErrorMessages.properties 2007-10-27 00:31:43.000000000 -0700 @@ -524,6 +524,7 @@ ConnectionProperties.relaxAutoCommit=If the version of MySQL the driver connects to does not support transactions, still allow calls to commit(), rollback() and setAutoCommit() (true/false, defaults to 'false')? ConnectionProperties.reportMetricsIntervalMillis=If 'gatherPerfMetrics' is enabled, how often should they be logged (in ms)? ConnectionProperties.requireSSL=Require SSL connection if useSSL=true? (defaults to 'false'). +ConnectionProperties.requireSSLcert=Require SSL certificate if using SSL? (defaults to 'true'). ConnectionProperties.resourceId=A globally unique name that identifies the resource that this datasource or connection is connected to, used for XAResource.isSameRM() when the driver can't determine this value based on hostnames used in the URL ConnectionProperties.resultSetSizeThreshold=If the usage advisor is enabled, how many rows should a result set contain before the driver warns that it is suspiciously large? ConnectionProperties.retainStatementAfterResultSetClose=Should the driver retain the Statement reference in a ResultSet after ResultSet.close() has been called. This is not JDBC-compliant after JDBC-4.0. [root@number8 jdbc]# diff -ur ExportControlled.java.~1~ ExportControlled.java diff -ur ExportControlled.java.~1~ ExportControlled.java --- ExportControlled.java.~1~ 2007-10-05 12:08:45.000000000 -0700 +++ ExportControlled.java 2007-10-27 01:05:50.000000000 -0700 @@ -74,7 +74,11 @@ */ protected static void transformSocketToSSLSocket(MysqlIO mysqlIO) throws SQLException { - javax.net.ssl.SSLSocketFactory sslFact = getSSLSocketFactoryDefaultOrConfigured(mysqlIO); + javax.net.ssl.SSLSocketFactory sslFact = + (mysqlIO.connection.getRequireSSLcert())? + getSSLSocketFactoryDefaultOrConfigured(mysqlIO): + (TrustingSSLSocketFactory) + TrustingSSLSocketFactory.getDefault2(); try { mysqlIO.mysqlConnection = sslFact.createSocket( @@ -230,4 +234,4 @@ } } -} \ No newline at end of file +} [root@number8 jdbc]#