Skip to content

Add CA bundle version and pinning status to user agent string#109

Open
mihir-pradhan wants to merge 1 commit into
masterfrom
ztcapin-479
Open

Add CA bundle version and pinning status to user agent string#109
mihir-pradhan wants to merge 1 commit into
masterfrom
ztcapin-479

Conversation

@mihir-pradhan

@mihir-pradhan mihir-pradhan commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Description

  • Added CA_BUNDLE_VERSION = "1.0" constant in Http.java
  • Modified the legacy constructor and ClientBuilder.build() to append ca_bundle/1.0 and (ca_pinning=enabled|disabled) to the user agent string based on the disableCaPinning runtime state
  • The pinning status is derived from the same disableCaPinning flag that configures TLS, so the reported value always matches the client's actual pinning state

How Has This Been Tested?

  • testDefaultBuilder_includesCaBundleVersion — verifies ca_bundle/1.0 is present in the user agent
  • testDefaultBuilder_includesCaPinningEnabled — verifies (ca_pinning=enabled) when pinning is not disabled
  • testDisableCaPinning_includesCaPinningDisabled — verifies (ca_pinning=disabled) when disableCaPinning() is called
  • testLegacyConstructor_includesCaBundleAndPinningEnabled — verifies both fields present via the deprecated constructor path

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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