Skip to content

Add builder option to disable CA certificate pinning#56

Merged
mihir-pradhan merged 1 commit into
mainfrom
ztcapin-505
Jul 6, 2026
Merged

Add builder option to disable CA certificate pinning#56
mihir-pradhan merged 1 commit into
mainfrom
ztcapin-505

Conversation

@mihir-pradhan

Copy link
Copy Markdown
Contributor

Summary

  • Adds disableCaPinning() method to Client.Builder that disables the bundled CA certificate pin set while keeping TLS verification active via the system trust store
  • Validates mutual exclusivity with setCACerts() — throws DuoException if both are used
  • Uses CertificatePinner.DEFAULT in OkHttp when pinning is disabled

Test plan

  • disableCaPinning() builds a client successfully
  • Combining disableCaPinning() with setCACerts() throws (both orderings)
  • Pins are empty when pinning is disabled (verified via reflection)
  • Pins are present by default (verified via reflection)
  • Proxy + disabled pinning works
  • All existing tests still pass (44 total)

Relates to: https://cisco-sbg.atlassian.net/browse/ZTCAPIN-505

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mihir-pradhan
mihir-pradhan merged commit d4221e7 into main Jul 6, 2026
4 checks passed
@mihir-pradhan
mihir-pradhan deleted the ztcapin-505 branch July 6, 2026 18:04
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