Spot certificate rejections reported by BoringSSL (Electron) #231
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 458 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.367
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #231"
general
weight: 0.35
pimterry
getCauseFromErrorspots a client rejecting the certificate by OpenSSL's wording of the TLS alert, such as "tls alert certificate unknown". When Mockttp runs on BoringSSL, as it does inside Electron, the same alerts are worded only in upper case (...:SSL routines:OPENSSL_internal:SSLV3_ALERT_CERTIFICATE_UNKNOWN:...). So they become'unknown'and are logged as "Unknown TLS error". Only bad_certificate is already caught, by its error code (ERR_SSL_SSLV3_ALERT_BAD_CERTIFICATE).Repro
A plain Mockttp server, with a client that answers the server's certificate with each alert:
Results with Mockttp 4.6.4:
| Alert | Node 26 (OpenSSL 4.1) | Electron 45 (BoringSSL) |
|---|---|---|
| bad_certificate (42) | cert-rejected | cert-rejected |
| certificate_revoked (44) | cert-rejected | unknown |
| certificate_expired (45) | cert-rejected | unknown |
| certificate_unknown (46), Chrome's | cert-rejected | unknown |
| unknown_ca (48) | cert-rejected | unknown |
| certificate_required (116) | cert-rejected | unknown |
| handshake_failure (40) | unknown | unknown |
| unsupported_certificate (43) | unknown | unknown |
Fix
The single error-code check becomes a pattern covering the alerts the message checks already catch: bad certificate, certificate unknown, expired, revoked or required, and unknown CA. It matches the codes of both libraries, such as
ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN,ERR_SSL_TLS_ALERT_CERTIFICATE_UNKNOWNandERR_SSL_SSL/TLS_ALERT_CERTIFICATE_UNKNOWN. With the fix, both runtimes give the Node column above for all eight alerts. Other alerts are unchanged, including unsupported_certificate, which OpenSSL doesn't count either.Test
test/tls-error-cause.spec.tschecksgetCauseFromError(now exported) with errors copied from real runs. It covers OpenSSL and BoringSSL rejections, and other alerts that aren't rejections. The BoringSSL case fails without the fix. I didn't add an integration test, because the Node test runs can't produce BoringSSL's wording.Found while running Mockttp inside an Electron app, where Chrome on an Android device refusing the certificate always showed as
'unknown'.The Node test suite passes locally (
mocha test/*/.spec.ts: 854 passing, 2 pending). I haven't run the browser tests, but this code is server-side only.🤖 Generated with Claude Code