Skip to content

Enable PQ TLS for outbound com by default - #4617

Open
hwupathum wants to merge 1 commit into
wso2:4.12.xfrom
hwupathum:pq-tls-client
Open

Enable PQ TLS for outbound com by default#4617
hwupathum wants to merge 1 commit into
wso2:4.12.xfrom
hwupathum:pq-tls-client

Conversation

@hwupathum

Copy link
Copy Markdown

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc.

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Improvements
    • Improved TLS client compatibility by enabling early key exchange groups during startup when the supported security provider is configured.
    • Updated cryptographic support to improve compatibility with newer secure communication standards.

Walkthrough

The PR updates the Bouncy Castle version and configures Bouncy Castle JSSE client early-key-share groups during Carbon core startup.

Changes

Bouncy Castle JSSE update

Layer / File(s) Summary
Bouncy Castle version update
parent/pom.xml
The bouncycastle.version property changes to 1.84.0.wso2v1.
JSSE provider configuration
core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreActivator.java
Carbon core sets the client early-key-share groups to X25519,X25519MLKEM768 during Bouncy Castle JSSE provider initialization.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: wso2-jenkins-bot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description contains only the template placeholders and provides no completed information about purpose, implementation, testing, documentation, or security checks. Complete the required sections with the change rationale, implementation details, testing evidence, documentation impact, security checks, and migration information.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: enabling post-quantum TLS for outbound communication by default.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreActivator.java`:
- Line 85: Update the startup logic in CarbonCoreActivator to set the
org.bouncycastle.jsse.client.earlyKeyShares default only when System.getProperty
for that key returns null, preserving any operator-supplied value.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0fc223ce-199d-4379-84a9-3715701dbb8e

📥 Commits

Reviewing files that changed from the base of the PR and between e3587ef and bf46d92.

📒 Files selected for processing (2)
  • core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreActivator.java
  • parent/pom.xml

(Class.forName("org.bouncycastle.jsse.provider.BouncyCastleJsseProvider")).
getDeclaredConstructor().newInstance();
Security.insertProviderAt(jsseProvider, 1);
System.setProperty("org.bouncycastle.jsse.client.earlyKeyShares", "X25519,X25519MLKEM768");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

file='core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreActivator.java'

printf '%s\n' '--- target context ---'
sed -n '60,105p' "$file"

printf '%s\n' '--- references to the property ---'
rg -n -C 3 'org\.bouncycastle\.jsse\.client\.earlyKeyShares|earlyKeyShares' .

printf '%s\n' '--- activator lifecycle and property setup ---'
rg -n -C 4 'class CarbonCoreActivator|start\(|stop\(|System\.setProperty|System\.getProperty' "$file"

Repository: wso2/carbon-kernel

Length of output: 6767


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- Bouncy Castle dependency declarations ---'
rg -n -i -C 3 'bouncycastle|bcprov|bctls|bcutil|jsse' --glob 'pom.xml' --glob '*.xml' --glob '*.properties' --glob '*.gradle' --glob '*.gradle.kts' .

printf '%s\n' '--- provider configuration constants and documentation ---'
rg -n -i -C 4 'JSSE_PROVIDER_BC|JSSE_PROVIDER|early key|earlyKeyShares|named group|BouncyCastle JSSE' \
  --glob '!target/**' --glob '!build/**' .

printf '%s\n' '--- relevant project documentation files ---'
git ls-files | rg -i '(^|/)(readme|security|configuration|deployment|carbon\.xml|defaults).*|bouncycastle|jsse'

Repository: wso2/carbon-kernel

Length of output: 27773


🌐 Web query:

Bouncy Castle JSSE org.bouncycastle.jsse.client.earlyKeyShares system property default

💡 Result:

The system property org.bouncycastle.jsse.client.earlyKeyShares does not have a defined default value; if the property is not explicitly set, the Bouncy Castle JSSE (BCJSSE) client behaves as if no early key shares are configured [1][2]. When this property is used, it accepts a comma-separated list of group names, following the same syntax as the standard jdk.tls.namedGroups property [1][2]. Any groups specified in this property must be independently enabled as supported groups—either by default or through other configurations such as jdk.tls.namedGroups or SSLParameters.namedGroups—otherwise, they will be ignored [1][2]. The property is read whenever a BCJSSE SSLContext is created and affects all client connections established using that context [1]. Alternatively, developers can control early key shares programmatically using the BCSSLParameters.earlyKeyShares property [1][3].

Citations:


Preserve an operator-supplied earlyKeyShares value.

org.bouncycastle.jsse.client.earlyKeyShares controls BCJSSE SSLContext creation. Set this default only when System.getProperty(...) == null; otherwise, the startup code overrides the operator’s TLS configuration.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreActivator.java`
at line 85, Update the startup logic in CarbonCoreActivator to set the
org.bouncycastle.jsse.client.earlyKeyShares default only when System.getProperty
for that key returns null, preserving any operator-supplied value.

Source: MCP tools

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.

1 participant