Skip to content

Commit

Permalink
check legacy IS_FIPS_ENABLED (#2470)
Browse files Browse the repository at this point in the history
  • Loading branch information
aimethed authored Dec 12, 2024
1 parent c639820 commit 4a41f7e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
public class OracleJdbcConnectionFactory extends GenericJdbcConnectionFactory
{
public static final String IS_FIPS_ENABLED = "is_fips_enabled";
public static final String IS_FIPS_ENABLED_LEGACY = "is_FIPS_Enabled";
private final DatabaseConnectionInfo databaseConnectionInfo;
private final DatabaseConnectionConfig databaseConnectionConfig;
private static final Logger LOGGER = LoggerFactory.getLogger(OracleJdbcConnectionFactory.class);
Expand All @@ -46,8 +47,8 @@ public class OracleJdbcConnectionFactory extends GenericJdbcConnectionFactory

/**
* @param databaseConnectionConfig database connection configuration {@link DatabaseConnectionConfig}
* @param databaseConnectionInfo
*/
* @param databaseConnectionInfo
*/
public OracleJdbcConnectionFactory(DatabaseConnectionConfig databaseConnectionConfig, DatabaseConnectionInfo databaseConnectionInfo)
{
super(databaseConnectionConfig, null, databaseConnectionInfo);
Expand All @@ -68,7 +69,7 @@ public Connection getConnection(final JdbcCredentialProvider jdbcCredentialProvi
properties.put("javax.net.ssl.trustStoreType", "JKS");
properties.put("javax.net.ssl.trustStorePassword", "changeit");
properties.put("oracle.net.ssl_server_dn_match", "true");
if (System.getenv().getOrDefault(IS_FIPS_ENABLED, "false").equalsIgnoreCase("true")) {
if (System.getenv().getOrDefault(IS_FIPS_ENABLED, "false").equalsIgnoreCase("true") || System.getenv().getOrDefault(IS_FIPS_ENABLED_LEGACY, "false").equalsIgnoreCase("true")) {
properties.put("oracle.net.ssl_cipher_suites", "(TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA)");
}
}
Expand Down

0 comments on commit 4a41f7e

Please sign in to comment.