Skip to content

feat(bigquery-jdbc): add SSLTrustStoreType and SSLTrustStoreProvider connection properties#13858

Merged
logachev merged 3 commits into
mainfrom
jdbc/sslTrustStore-support
Jul 22, 2026
Merged

feat(bigquery-jdbc): add SSLTrustStoreType and SSLTrustStoreProvider connection properties#13858
logachev merged 3 commits into
mainfrom
jdbc/sslTrustStore-support

Conversation

@keshavdandeva

Copy link
Copy Markdown
Contributor

b/537362384

This PR introduces the SSLTrustStoreType and SSLTrustStoreProvider connection properties.

Key Changes:

  • New Connection Properties: Added SSLTrustStoreType (defaults to KeyStore::getDefaultType via lazy evaluation) and SSLTrustStoreProvider to BigQueryJdbcUrlUtility and the DataSource POJO.
  • Proxy Configuration: Plumbed the new properties into BigQueryConnection and down through to BigQueryJdbcProxyUtility.
  • Code Refactoring: Added the keystore instantiation logic as loadKeyStore() helper method shared by both the REST (Apache HC5) and gRPC (Netty) network transport builders.

Testing:

  • Unit Tests: Added tests in BigQueryJdbcProxyUtilityTest validating that passing valid types works and invalid providers correctly throw NoSuchProviderException.
  • Integration Tests: Extended ITLocalSslValidationTest to launch a subprocess that explicitly passes the new properties into the JDBC connection URL, proving that the properties can successfully negotiate a real end-to-end TLS handshake against the mock HTTPS server.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for configuring the SSL TrustStore type and provider in the BigQuery JDBC driver, allowing users to customize how the KeyStore is loaded. The feedback recommends removing redundant String.valueOf() calls on variables that are already strings in DataSource.java, and suggests making the loadKeyStore method in BigQueryJdbcProxyUtility.java more robust by checking for and trimming empty or blank strings to prevent potential exceptions.

@keshavdandeva

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for configuring the SSL TrustStore type and provider in the BigQuery JDBC driver, updating connection properties, data source configuration, and key store loading logic. A review comment correctly identifies a bug in the integration test where the truststore password property is incorrectly named 'SSLTrustStorePassword' instead of 'SSLTrustStorePwd', which prevents the password from being passed to the driver.

@keshavdandeva
keshavdandeva marked this pull request as ready for review July 22, 2026 02:58
@keshavdandeva
keshavdandeva requested review from a team as code owners July 22, 2026 02:58
@keshavdandeva

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for configuring a custom SSL TrustStore type and provider in the BigQuery JDBC driver by introducing the SSLTrustStoreType and SSLTrustStoreProvider connection properties. These properties are propagated through the connection and data source configurations to customize how the KeyStore is loaded. The feedback suggests narrowing the throws clause of the new loadKeyStore helper method from GeneralSecurityException to KeyStoreException and NoSuchProviderException to improve type safety and avoid forcing callers to handle overly broad exceptions.

@logachev
logachev merged commit 9449be1 into main Jul 22, 2026
206 checks passed
@logachev
logachev deleted the jdbc/sslTrustStore-support branch July 22, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants