Skip to content

Comments

WebDAV Certificate Pinning & iOS API Modernization#1234

Open
ppdms wants to merge 2 commits intozotero:masterfrom
ppdms:master
Open

WebDAV Certificate Pinning & iOS API Modernization#1234
ppdms wants to merge 2 commits intozotero:masterfrom
ppdms:master

Conversation

@ppdms
Copy link

@ppdms ppdms commented Jan 18, 2026

Implements certificate pinning for WebDAV servers with self-signed certificates using a Trust-On-First-Use (TOFU) security model.

Screenshot 2026-01-18 at 3 29 55 PM

Security Features

  • ✅ Certificate pinning with byte-for-byte validation
  • ✅ User trust prompts showing Common Name & SHA-256 fingerprint
  • ✅ Certificate change detection (MITM protection)
  • ✅ Expiration validation with user alerts
  • ✅ Thread-safe implementation with NSLock protection
  • ✅ 60-second timeout to prevent UI hangs

iOS Modernization

  • Migrated deprecated UIButton APIs → Configuration API
  • Migrated UIMenuController → UIMenu
  • Updated AVURLAsset to async property loading
  • Added @sendable conformance to URLSession delegates
  • Fixed retain cycles in closure captures

Implementation Notes

  • Certificates stored in UserDefaults (public data)
  • Host validation ensures only WebDAV servers use custom trust
  • Comprehensive inline documentation and test coverage

Testing

  • Unit tests: WebDavCertificatePinningSpec
  • Certificate storage/retrieval verified
  • Trust flow and verification reset tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant