diff --git a/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightConnection.java b/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightConnection.java index 35d443cd2147e..0ce8cb57c5929 100644 --- a/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightConnection.java +++ b/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightConnection.java @@ -100,7 +100,7 @@ private static ArrowFlightSqlClientHandler createNewClientHandler( .withTrustStorePassword(config.getTrustStorePassword()) .withSystemTrustStore(config.useSystemTrustStore()) .withBufferAllocator(allocator) - .withTlsEncryption(config.useTls()) + .withEncryption(config.useEncryption()) .withDisableCertificateVerification(config.getDisableCertificateVerification()) .withToken(config.getToken()) .withCallOptions(config.toCallOption()) diff --git a/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java b/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java index 6d78f8a0933d6..afac6c164708b 100644 --- a/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java +++ b/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java @@ -345,7 +345,7 @@ public static final class Builder { private String trustStorePath; private String trustStorePassword; private String token; - private boolean useTls; + private boolean useEncryption; private boolean disableCertificateVerification; private boolean useSystemTrustStore; private BufferAllocator allocator; @@ -419,11 +419,11 @@ public Builder withTrustStorePassword(final String trustStorePassword) { /** * Sets whether to use TLS encryption in this handler. * - * @param useTls whether to use TLS encryption. + * @param useEncryption whether to use TLS encryption. * @return this instance. */ - public Builder withTlsEncryption(final boolean useTls) { - this.useTls = useTls; + public Builder withEncryption(final boolean useEncryption) { + this.useEncryption = useEncryption; return this; } @@ -533,7 +533,7 @@ public ArrowFlightSqlClientHandler build() throws SQLException { withMiddlewareFactories(new ClientCookieMiddleware.Factory()); middlewareFactories.forEach(clientBuilder::intercept); Location location; - if (useTls) { + if (useEncryption) { location = Location.forGrpcTls(host, port); clientBuilder.useTls(); } else { @@ -541,7 +541,7 @@ public ArrowFlightSqlClientHandler build() throws SQLException { } clientBuilder.location(location); - if (useTls) { + if (useEncryption) { if (disableCertificateVerification) { clientBuilder.verifyServer(false); } else { diff --git a/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/utils/ArrowFlightConnectionConfigImpl.java b/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/utils/ArrowFlightConnectionConfigImpl.java index 9bbb258da1773..40ea5fb39d732 100644 --- a/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/utils/ArrowFlightConnectionConfigImpl.java +++ b/java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/utils/ArrowFlightConnectionConfigImpl.java @@ -113,8 +113,8 @@ public boolean useSystemTrustStore() { * * @return whether to use TLS encryption. */ - public boolean useTls() { - return ArrowFlightConnectionProperty.SSL.getBoolean(properties); + public boolean useEncryption() { + return ArrowFlightConnectionProperty.USE_ENCRYPTION.getBoolean(properties); } public boolean getDisableCertificateVerification() { @@ -149,7 +149,7 @@ public enum ArrowFlightConnectionProperty implements ConnectionProperty { PORT("port", null, Type.NUMBER, true), USER("user", null, Type.STRING, false), PASSWORD("password", null, Type.STRING, false), - SSL("ssl", true, Type.BOOLEAN, false), + USE_ENCRYPTION("useEncryption", true, Type.BOOLEAN, false), CERTIFICATE_VERIFICATION("disableCertificateVerification", false, Type.BOOLEAN, false), TRUST_STORE("trustStore", null, Type.STRING, false), TRUST_STORE_PASSWORD("trustStorePassword", null, Type.STRING, false), diff --git a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcDriverTest.java b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcDriverTest.java index 78938e354ba1a..49fd4abe43a6b 100644 --- a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcDriverTest.java +++ b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcDriverTest.java @@ -115,7 +115,7 @@ public void testShouldConnectWhenProvidedWithValidUrl() throws Exception { driver.connect("jdbc:arrow-flight://" + dataSource.getConfig().getHost() + ":" + dataSource.getConfig().getPort() + "?" + - "ssl=false", + "useEncryption=false", dataSource.getProperties(dataSource.getConfig().getUser(), dataSource.getConfig().getPassword()))) { assert connection.isValid(300); } diff --git a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcFactoryTest.java b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcFactoryTest.java index f0e1c963177f9..4cd85bcd14efa 100644 --- a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcFactoryTest.java +++ b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcFactoryTest.java @@ -78,7 +78,7 @@ public void testShouldBeAbleToEstablishAConnectionSuccessfully() throws Exceptio properties.putAll(ImmutableMap.of( ArrowFlightConnectionProperty.HOST.camelName(), "localhost", ArrowFlightConnectionProperty.PORT.camelName(), 32010, - ArrowFlightConnectionProperty.SSL.camelName(), false)); + ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), false)); try (Connection connection = factory.newConnection(driver, constructor.newInstance(), "jdbc:arrow-flight://localhost:32010", properties)) { diff --git a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ConnectionTest.java b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ConnectionTest.java index a39a04b6e450f..2a530b30369ef 100644 --- a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ConnectionTest.java +++ b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ConnectionTest.java @@ -91,7 +91,7 @@ public void testUnencryptedConnectionShouldOpenSuccessfullyWhenProvidedValidCred userTest); properties.put(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); - properties.put("ssl", false); + properties.put("useEncryption", false); try (Connection connection = DriverManager.getConnection( "jdbc:arrow-flight://" + FLIGHT_SERVER_TEST_RULE.getHost() + ":" + @@ -154,7 +154,7 @@ public void testUnencryptedConnectionProvidingInvalidPort() userTest); properties.put(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); - properties.put(ArrowFlightConnectionProperty.SSL.camelName(), + properties.put(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), false); final String invalidUrl = "jdbc:arrow-flight://" + FLIGHT_SERVER_TEST_RULE.getHost() + ":" + 65537; @@ -192,7 +192,7 @@ public void testUnencryptedConnectionShouldOpenSuccessfullyWithoutAuthentication properties.put(ArrowFlightConnectionProperty.HOST.camelName(), "localhost"); properties.put(ArrowFlightConnectionProperty.PORT.camelName(), FLIGHT_SERVER_TEST_RULE.getPort()); - properties.put(ArrowFlightConnectionProperty.SSL.camelName(), + properties.put(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), false); try (Connection connection = DriverManager .getConnection("jdbc:arrow-flight://localhost:32010", properties)) { @@ -217,7 +217,7 @@ public void testUnencryptedConnectionShouldThrowExceptionWhenProvidedWithInvalid "invalidUser"); properties.put(ArrowFlightConnectionProperty.PORT.camelName(), FLIGHT_SERVER_TEST_RULE.getPort()); - properties.put(ArrowFlightConnectionProperty.SSL.camelName(), + properties.put(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), false); properties.put(ArrowFlightConnectionProperty.PASSWORD.camelName(), "invalidPassword"); @@ -241,7 +241,7 @@ public void testTLSConnectionPropertyFalseCorrectCastUrlWithDriverManager() thro Connection connection = DriverManager.getConnection( String.format( - "jdbc:arrow-flight://localhost:%s?user=%s&password=%s&ssl=false", + "jdbc:arrow-flight://localhost:%s?user=%s&password=%s&useEncryption=false", FLIGHT_SERVER_TEST_RULE.getPort(), userTest, passTest)); @@ -267,7 +267,7 @@ public void testTLSConnectionPropertyFalseCorrectCastUrlAndPropertiesUsingSetPro userTest); properties.setProperty(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); - properties.setProperty(ArrowFlightConnectionProperty.SSL.camelName(), "false"); + properties.setProperty(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), "false"); Connection connection = DriverManager.getConnection( String.format( @@ -295,7 +295,7 @@ public void testTLSConnectionPropertyFalseCorrectCastUrlAndPropertiesUsingPutWit userTest); properties.put(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); - properties.put(ArrowFlightConnectionProperty.SSL.camelName(), false); + properties.put(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), false); Connection connection = DriverManager.getConnection( String.format( @@ -320,7 +320,7 @@ public void testTLSConnectionPropertyFalseIntegerCorrectCastUrlWithDriverManager Connection connection = DriverManager.getConnection( String.format( - "jdbc:arrow-flight://localhost:%s?user=%s&password=%s&ssl=0", + "jdbc:arrow-flight://localhost:%s?user=%s&password=%s&useEncryption=0", FLIGHT_SERVER_TEST_RULE.getPort(), userTest, passTest)); @@ -346,7 +346,7 @@ public void testTLSConnectionPropertyFalseIntegerCorrectCastUrlAndPropertiesUsin userTest); properties.setProperty(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); - properties.setProperty(ArrowFlightConnectionProperty.SSL.camelName(), "0"); + properties.setProperty(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), "0"); Connection connection = DriverManager.getConnection( String.format( @@ -375,7 +375,7 @@ public void testTLSConnectionPropertyFalseIntegerCorrectCastUrlAndPropertiesUsin userTest); properties.put(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); - properties.put(ArrowFlightConnectionProperty.SSL.camelName(), 0); + properties.put(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), 0); Connection connection = DriverManager.getConnection( String.format( @@ -400,7 +400,7 @@ public void testThreadPoolSizeConnectionPropertyCorrectCastUrlWithDriverManager( Connection connection = DriverManager.getConnection( String.format( - "jdbc:arrow-flight://localhost:%s?user=%s&password=%s&threadPoolSize=1&ssl=%s", + "jdbc:arrow-flight://localhost:%s?user=%s&password=%s&threadPoolSize=1&useEncryption=%s", FLIGHT_SERVER_TEST_RULE.getPort(), userTest, passTest, @@ -428,7 +428,7 @@ public void testThreadPoolSizeConnectionPropertyCorrectCastUrlAndPropertiesUsing properties.setProperty(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); properties.setProperty(ArrowFlightConnectionProperty.THREAD_POOL_SIZE.camelName(), "1"); - properties.put("ssl", false); + properties.put("useEncryption", false); Connection connection = DriverManager.getConnection( String.format( @@ -458,7 +458,7 @@ public void testThreadPoolSizeConnectionPropertyCorrectCastUrlAndPropertiesUsing properties.put(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); properties.put(ArrowFlightConnectionProperty.THREAD_POOL_SIZE.camelName(), 1); - properties.put("ssl", false); + properties.put("useEncryption", false); Connection connection = DriverManager.getConnection( String.format( @@ -483,7 +483,7 @@ public void testPasswordConnectionPropertyIntegerCorrectCastUrlWithDriverManager Connection connection = DriverManager.getConnection( String.format( - "jdbc:arrow-flight://localhost:%s?user=%s&password=%s&ssl=%s", + "jdbc:arrow-flight://localhost:%s?user=%s&password=%s&useEncryption=%s", FLIGHT_SERVER_TEST_RULE.getPort(), userTest, passTest, @@ -510,7 +510,7 @@ public void testPasswordConnectionPropertyIntegerCorrectCastUrlAndPropertiesUsin userTest); properties.setProperty(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); - properties.put("ssl", false); + properties.put("useEncryption", false); Connection connection = DriverManager.getConnection( String.format( @@ -539,7 +539,7 @@ public void testPasswordConnectionPropertyIntegerCorrectCastUrlAndPropertiesUsin userTest); properties.put(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); - properties.put("ssl", false); + properties.put("useEncryption", false); Connection connection = DriverManager.getConnection( String.format( diff --git a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ConnectionTlsTest.java b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ConnectionTlsTest.java index 92429d31c5039..2d976a4d02d13 100644 --- a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ConnectionTlsTest.java +++ b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ConnectionTlsTest.java @@ -63,7 +63,7 @@ public class ConnectionTlsTest { .host("localhost") .randomPort() .authentication(authentication) - .useTls(certKey.cert, certKey.key) + .useEncryption(certKey.cert, certKey.key) .producer(PRODUCER) .build(); } @@ -102,7 +102,7 @@ public void testGetEncryptedClientAuthenticatedWithDisableCertVerification() thr .withPassword(credentials.getPassword()) .withDisableCertificateVerification(true) .withBufferAllocator(allocator) - .withTlsEncryption(true) + .withEncryption(true) .build()) { assertNotNull(client); } @@ -127,7 +127,7 @@ public void testGetEncryptedClientAuthenticated() throws Exception { .withTrustStorePath(trustStorePath) .withTrustStorePassword(trustStorePass) .withBufferAllocator(allocator) - .withTlsEncryption(true) + .withEncryption(true) .build()) { assertNotNull(client); } @@ -149,7 +149,7 @@ public void testGetEncryptedClientWithNoCertificateOnKeyStore() throws Exception .withTrustStorePath(noCertificateKeyStorePath) .withTrustStorePassword(noCertificateKeyStorePassword) .withBufferAllocator(allocator) - .withTlsEncryption(true) + .withEncryption(true) .build()) { Assert.fail(); } @@ -168,7 +168,7 @@ public void testGetNonAuthenticatedEncryptedClientNoAuth() throws Exception { .withTrustStorePath(trustStorePath) .withTrustStorePassword(trustStorePass) .withBufferAllocator(allocator) - .withTlsEncryption(true) + .withEncryption(true) .build()) { assertNotNull(client); } @@ -190,7 +190,7 @@ public void testGetEncryptedClientWithKeyStoreBadPasswordAndNoAuth() throws Exce .withTrustStorePath(trustStorePath) .withTrustStorePassword(keyStoreBadPassword) .withBufferAllocator(allocator) - .withTlsEncryption(true) + .withEncryption(true) .build()) { Assert.fail(); } @@ -242,7 +242,7 @@ public void testGetAuthenticatedEncryptedConnectionWithKeyStoreBadPassword() thr userTest); properties.put(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); - properties.put(ArrowFlightConnectionProperty.SSL.camelName(), true); + properties.put(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), true); properties.put(ArrowFlightConnectionProperty.TRUST_STORE.camelName(), trustStorePath); properties.put(ArrowFlightConnectionProperty.TRUST_STORE_PASSWORD.camelName(), "badpassword"); @@ -264,7 +264,7 @@ public void testGetNonAuthenticatedEncryptedConnection() throws Exception { properties.put(ArrowFlightConnectionProperty.HOST.camelName(), FLIGHT_SERVER_TEST_RULE.getHost()); properties.put(ArrowFlightConnectionProperty.PORT.camelName(), FLIGHT_SERVER_TEST_RULE.getPort()); - properties.put(ArrowFlightConnectionProperty.SSL.camelName(), true); + properties.put(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), true); properties.put(ArrowFlightConnectionProperty.USE_SYSTEM_TRUST_STORE.camelName(), false); properties.put(ArrowFlightConnectionProperty.TRUST_STORE.camelName(), trustStorePath); properties.put(ArrowFlightConnectionProperty.TRUST_STORE_PASSWORD.camelName(), trustStorePass); @@ -288,7 +288,8 @@ public void testTLSConnectionPropertyTrueCorrectCastUrlWithDriverManager() throw final Connection connection = DriverManager.getConnection( String.format( - "jdbc:arrow-flight://localhost:%s?user=%s&password=%s&ssl=true&useSystemTrustStore=false&%s=%s&%s=%s", + "jdbc:arrow-flight://localhost:%s?user=%s&password=%s" + + "&useEncryption=true&useSystemTrustStore=false&%s=%s&%s=%s", FLIGHT_SERVER_TEST_RULE.getPort(), userTest, passTest, @@ -318,7 +319,7 @@ public void testTLSConnectionPropertyTrueCorrectCastUrlAndPropertiesUsingSetProp properties.setProperty(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); properties.setProperty(ArrowFlightConnectionProperty.TRUST_STORE.camelName(), trustStorePath); properties.setProperty(ArrowFlightConnectionProperty.TRUST_STORE_PASSWORD.camelName(), trustStorePass); - properties.setProperty(ArrowFlightConnectionProperty.SSL.camelName(), "true"); + properties.setProperty(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), "true"); properties.setProperty(ArrowFlightConnectionProperty.USE_SYSTEM_TRUST_STORE.camelName(), "false"); final Connection connection = DriverManager.getConnection( @@ -346,7 +347,7 @@ public void testTLSConnectionPropertyTrueCorrectCastUrlAndPropertiesUsingPutWith properties.put(ArrowFlightConnectionProperty.USER.camelName(), userTest); properties.put(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); - properties.put(ArrowFlightConnectionProperty.SSL.camelName(), true); + properties.put(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), true); properties.put(ArrowFlightConnectionProperty.USE_SYSTEM_TRUST_STORE.camelName(), false); properties.put(ArrowFlightConnectionProperty.TRUST_STORE.camelName(), trustStorePath); properties.put(ArrowFlightConnectionProperty.TRUST_STORE_PASSWORD.camelName(), trustStorePass); @@ -374,7 +375,7 @@ public void testTLSConnectionPropertyTrueIntegerCorrectCastUrlWithDriverManager( final Connection connection = DriverManager.getConnection( String.format( - "jdbc:arrow-flight://localhost:%s?user=%s&password=%s&ssl=1&useSystemTrustStore=0&%s=%s&%s=%s", + "jdbc:arrow-flight://localhost:%s?user=%s&password=%s&useEncryption=1&useSystemTrustStore=0&%s=%s&%s=%s", FLIGHT_SERVER_TEST_RULE.getPort(), userTest, passTest, @@ -404,7 +405,7 @@ public void testTLSConnectionPropertyTrueIntegerCorrectCastUrlAndPropertiesUsing properties.setProperty(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); properties.setProperty(ArrowFlightConnectionProperty.TRUST_STORE.camelName(), trustStorePath); properties.setProperty(ArrowFlightConnectionProperty.TRUST_STORE_PASSWORD.camelName(), trustStorePass); - properties.setProperty(ArrowFlightConnectionProperty.SSL.camelName(), "1"); + properties.setProperty(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), "1"); properties.setProperty(ArrowFlightConnectionProperty.USE_SYSTEM_TRUST_STORE.camelName(), "0"); final Connection connection = DriverManager.getConnection( @@ -430,7 +431,7 @@ public void testTLSConnectionPropertyTrueIntegerCorrectCastUrlAndPropertiesUsing properties.put(ArrowFlightConnectionProperty.USER.camelName(), userTest); properties.put(ArrowFlightConnectionProperty.PASSWORD.camelName(), passTest); - properties.put(ArrowFlightConnectionProperty.SSL.camelName(), 1); + properties.put(ArrowFlightConnectionProperty.USE_ENCRYPTION.camelName(), 1); properties.put(ArrowFlightConnectionProperty.USE_SYSTEM_TRUST_STORE.camelName(), 0); properties.put(ArrowFlightConnectionProperty.TRUST_STORE.camelName(), trustStorePath); properties.put(ArrowFlightConnectionProperty.TRUST_STORE_PASSWORD.camelName(), trustStorePass); diff --git a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/FlightServerTestRule.java b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/FlightServerTestRule.java index dec3ca286326a..cbe706490c85e 100644 --- a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/FlightServerTestRule.java +++ b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/FlightServerTestRule.java @@ -115,24 +115,24 @@ public ArrowFlightJdbcConnectionPoolDataSource createConnectionPoolDataSource() return ArrowFlightJdbcConnectionPoolDataSource.createNewDataSource(properties); } - public ArrowFlightJdbcConnectionPoolDataSource createConnectionPoolDataSource(boolean useTls) { - setUseTls(useTls); + public ArrowFlightJdbcConnectionPoolDataSource createConnectionPoolDataSource(boolean useEncryption) { + setUseEncryption(useEncryption); return ArrowFlightJdbcConnectionPoolDataSource.createNewDataSource(properties); } - public Connection getConnection(boolean useTls, String token) throws SQLException { + public Connection getConnection(boolean useEncryption, String token) throws SQLException { properties.put("token", token); - return getConnection(useTls); + return getConnection(useEncryption); } - public Connection getConnection(boolean useTls) throws SQLException { - setUseTls(useTls); + public Connection getConnection(boolean useEncryption) throws SQLException { + setUseEncryption(useEncryption); return this.createDataSource().getConnection(); } - private void setUseTls(boolean useTls) { - properties.put("ssl", useTls); + private void setUseEncryption(boolean useEncryption) { + properties.put("useEncryption", useEncryption); } public MiddlewareCookie.Factory getMiddlewareCookieFactory() { @@ -149,7 +149,7 @@ private FlightServer initiateServer(Location location) throws IOException { .headerAuthenticator(authentication.authenticate()) .middleware(FlightServerMiddleware.Key.of("KEY"), middlewareCookieFactory); if (certKeyPair != null) { - builder.useTls(certKeyPair.cert, certKeyPair.key); + builder.useEncryption(certKeyPair.cert, certKeyPair.key); } return builder.build(); } @@ -294,7 +294,7 @@ public Builder authentication(final Authentication authentication) { * @param key The private key to use. * @return the Builder. */ - public Builder useTls(final File certChain, final File key) { + public Builder useEncryption(final File certChain, final File key) { certKeyPair = new CertKeyPair(certChain, key); return this; } diff --git a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/utils/ArrowFlightConnectionConfigImplTest.java b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/utils/ArrowFlightConnectionConfigImplTest.java index dec63c63b2098..4fb07428af4ef 100644 --- a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/utils/ArrowFlightConnectionConfigImplTest.java +++ b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/utils/ArrowFlightConnectionConfigImplTest.java @@ -22,9 +22,9 @@ import static org.apache.arrow.driver.jdbc.utils.ArrowFlightConnectionConfigImpl.ArrowFlightConnectionProperty.HOST; import static org.apache.arrow.driver.jdbc.utils.ArrowFlightConnectionConfigImpl.ArrowFlightConnectionProperty.PASSWORD; import static org.apache.arrow.driver.jdbc.utils.ArrowFlightConnectionConfigImpl.ArrowFlightConnectionProperty.PORT; -import static org.apache.arrow.driver.jdbc.utils.ArrowFlightConnectionConfigImpl.ArrowFlightConnectionProperty.SSL; import static org.apache.arrow.driver.jdbc.utils.ArrowFlightConnectionConfigImpl.ArrowFlightConnectionProperty.THREAD_POOL_SIZE; import static org.apache.arrow.driver.jdbc.utils.ArrowFlightConnectionConfigImpl.ArrowFlightConnectionProperty.USER; +import static org.apache.arrow.driver.jdbc.utils.ArrowFlightConnectionConfigImpl.ArrowFlightConnectionProperty.USE_ENCRYPTION; import static org.hamcrest.CoreMatchers.is; import java.util.List; @@ -86,8 +86,8 @@ public static List provideParameters() { (Function) ArrowFlightConnectionConfigImpl::getUser}, {PASSWORD, "password", (Function) ArrowFlightConnectionConfigImpl::getPassword}, - {SSL, RANDOM.nextBoolean(), - (Function) ArrowFlightConnectionConfigImpl::useTls}, + {USE_ENCRYPTION, RANDOM.nextBoolean(), + (Function) ArrowFlightConnectionConfigImpl::useEncryption}, {THREAD_POOL_SIZE, RANDOM.nextInt(getRuntime().availableProcessors()), (Function) ArrowFlightConnectionConfigImpl::threadPoolSize},