Skip to content

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

Merged
mihir-pradhan merged 2 commits into
masterfrom
ztcapin-479
Jul 28, 2026
Merged

Add CA bundle version and pinning status to user agent string#109
mihir-pradhan merged 2 commits 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>
Comment thread duo-client/src/main/java/com/duosecurity/client/Http.java Outdated
@mihir-pradhan
mihir-pradhan merged commit df00926 into master Jul 28, 2026
3 checks passed
@mihir-pradhan
mihir-pradhan deleted the ztcapin-479 branch July 28, 2026 15:34
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