Skip to content

fix for registration conflicts with BouncyCastleProvider#864

Merged
sreekanth-db merged 5 commits into
databricks:mainfrom
sreekanth-db:bouncycastle-register-issue
Jul 4, 2025
Merged

fix for registration conflicts with BouncyCastleProvider#864
sreekanth-db merged 5 commits into
databricks:mainfrom
sreekanth-db:bouncycastle-register-issue

Conversation

@sreekanth-db
Copy link
Copy Markdown
Collaborator

@sreekanth-db sreekanth-db commented Jun 25, 2025

Description

The core problem is from the static registration of the BouncyCastle Security Provider in Java's Security API. When multiple BouncyCastle library versions are on the classpath, each trying to register its "BC" provider, conflicts occur. This can arise from different versions being introduced by drivers, the application, or its dependencies. The first registered provider wins, leading to unpredictable behavior if an older or incompatible version is registered before the expected one. This causes difficult-to-diagnose runtime problems for customers, highlighting the need to isolate or control BouncyCastle registration.

Solution: We will no longer globally register BouncyCastleProvider in Java's security API. Instead, our driver will create a dedicated local BouncyCastleProvider instance for it usage.

Testing

Tested jwt flow in local

Additional Notes to the Reviewer

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 25, 2025

📊 Code Coverage Report

Overall Project 86.19% -0.06% 🟢
Files changed 14.29% 🔴

File Coverage
JwtPrivateKeyClientCredentials.java 58.88% -6.2% 🔴

Signed-off-by: Sreekanth Vadigi <sreekanth.vadigi@databricks.com>
@sreekanth-db sreekanth-db force-pushed the bouncycastle-register-issue branch from 8ec3bea to 1e64c46 Compare July 2, 2025 07:54
@sreekanth-db sreekanth-db requested a review from samikshya-db July 2, 2025 08:02
@samikshya-db
Copy link
Copy Markdown
Collaborator

2 comments :

  1. Let's stick to the description template for this repo
  2. Looks like the test coverage went down for jwtprivatekeyclientcredentials.java. Can you fix that?

Comment thread NEXT_CHANGELOG.md Outdated
Co-authored-by: Samikshya Chand <148681192+samikshya-db@users.noreply.github.com>
@sreekanth-db
Copy link
Copy Markdown
Collaborator Author

There is some issue with the coverage comparison workflow, will fix it in a subsequent pull request. Coverage percentage from local jacoco report for this branch is 86.31%

@sreekanth-db sreekanth-db merged commit e3d0d8d into databricks:main Jul 4, 2025
9 of 12 checks passed
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