-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Add SSL/TLS Support to DataCloud JDBC Driver #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add SSL/TLS Support to DataCloud JDBC Driver #89
Conversation
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/util/DirectDataCloudConnection.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/util/DirectDataCloudConnection.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/util/DirectDataCloudConnection.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/util/DirectDataCloudConnection.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/util/DirectDataCloudConnection.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/test/java/com/salesforce/datacloud/jdbc/util/DirectDataCloudConnectionTest.java
Outdated
Show resolved
Hide resolved
vogelsgesang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the overall behavior looks good now. I think we should implement the logic in a slightly different way, though
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/util/DirectDataCloudConnection.java
Outdated
Show resolved
Hide resolved
0cec757 to
a2f46c4
Compare
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (31.66%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
============================================
- Coverage 83.22% 82.41% -0.82%
- Complexity 1245 1297 +52
============================================
Files 103 107 +4
Lines 3709 3929 +220
Branches 369 407 +38
============================================
+ Hits 3087 3238 +151
- Misses 462 508 +46
- Partials 160 183 +23
🚀 New features to boost your workflow:
|
…ame system_truststore to default_tls to match standard naming conventions
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/util/DirectDataCloudConnection.java
Outdated
Show resolved
Hide resolved
...re/src/main/java/com/salesforce/datacloud/jdbc/core/DirectDataCloudConnectionProperties.java
Outdated
Show resolved
Hide resolved
- Replace DirectDataCloudConnectionProperties in favour of SslProperties for SSL configuration and channel building - Remove DirectDataCloudConnection
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/HyperDatasource.java
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/HyperDatasource.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/core/SslProperties.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/test/java/com/salesforce/datacloud/jdbc/core/DataCloudConnectionTest.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/core/SslProperties.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/core/SslProperties.java
Show resolved
Hide resolved
-Update LocalHyperTestBase to use builder pattern -Clean up SslProperties
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/HyperDatasource.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/core/SslProperties.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/core/SslProperties.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/core/SslProperties.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/HyperDatasource.java
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/HyperDatasource.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/test/java/com/salesforce/datacloud/jdbc/hyper/LocalHyperTestBase.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/core/SslProperties.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/core/SslProperties.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/core/SslProperties.java
Outdated
Show resolved
Hide resolved
jdbc-core/src/main/java/com/salesforce/datacloud/jdbc/core/SslProperties.java
Outdated
Show resolved
Hide resolved
…ern and improve validation - Updated tests to create real temporary files for validation
🔒 Add SSL/TLS Support to DataCloud JDBC Driver
This PR implements comprehensive SSL/TLS support for the DataCloud JDBC driver, enabling secure connections with automatic SSL mode detection and flexible certificate configuration.
📋 Changes Made
Core SSL Implementation
SslPropertiesclass with SSL/TLS auto-detectionSslModeenum with four auto-detected modes:DISABLED,DEFAULT_TLS,ONE_SIDED_TLS,MUTUAL_TLSGrpcSslContextsandNettyChannelBuilderSSL Mode
The driver automatically determines the SSL mode based on certificate properties:
DEFAULT_TLS- SSL with Java's system truststore (secure by default)ONE_SIDED_TLS- SSL with custom trust verification (JKS truststore or PEM CA cert)MUTUAL_TLS- Two-sided TLS with client certificate authenticationDISABLED- Plaintext connections (testing only, viassl.disabled=true)This wont break for clients using salesforce-datacloud jdbc driver, this is only a breaking change for salesforce-hyper,
Plaintext Connections: For plaintext connections (local testing), you must now explicitly pass
ssl.disabled=true:This change ensures security by default - all connections now use SSL unless explicitly disabled.
🔧 Configuration Examples
System Truststore SSL (Default - No Config Needed)
Custom Trust with JKS Truststore
Custom Trust with PEM CA Certificate
Mutual TLS with PEM Certificates
Mixed Configuration (JKS Trust + PEM Client Certs)
Plaintext Connection (Testing Only)
Spark DataSource Integration