Skip to content

feat(websockets): add ssl pinning - #21

Draft
edusperoni wants to merge 1 commit into
masterfrom
feat/ssl-pinning
Draft

edusperoni wants to merge 1 commit into
masterfrom
feat/ssl-pinning

Conversation

@edusperoni

Copy link
Copy Markdown
Contributor

wip: missing android implementation

@nx-cloud

nx-cloud Bot commented Apr 29, 2025 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 6c3dd89

Command Status Duration Result
nx affected --target=build.all ✅ Succeeded 48s View ↗
nx affected:lint ✅ Succeeded 2s View ↗

💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-11-21 03:20:54 UTC

@edusperoni
edusperoni force-pushed the feat/ssl-pinning branch 2 times, most recently from cbde523 to 2e45384 Compare November 21, 2026 01:33
Adds an `ssl` option to the WebSocket constructor on iOS and Android:

- validation: 'system' (default) | 'pins-only' | 'none'
- pins: public-key (SPKI SHA-256) pins, given as a PEM certificate or a
  base64 hash. With 'system' they must match a certificate of the
  validated chain; with 'pins-only' they must match the leaf, and the
  chain, hostname and expiry are not checked (self-signed / IP servers).
- ca: PEM roots that replace the system trust store.

Invalid or contradictory options throw from the constructor.

iOS evaluates server trust with SecTrust before anything is written to
the socket, replacing the RCTSR_SSLPinnedCertificates check (which
disabled chain validation and accepted any presented certificate equal
to a pinned one) and the DEBUG-only validation bypass.

index.ts now only installs the polyfill when no global WebSocket exists;
installWebsocketPolyfill() and the WebSocket class can be imported from
'@valor/nativescript-websockets/websocket' without side effects.
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