Support static Linux (musl) builds via CNIOBoringSSL; make GSSAPI opt-in #263
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 493 lines diff across 6 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.371
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #263"
general
weight: 0.35
FranzBusch
Motivation
swift-kafka-clientwraps the librdkafka C library, which links the system OpenSSL for TLS/crypto and the system libsasl2 (Cyrus SASL) for GSSAPI/Kerberos. A fully-static Linux binary built with the Swift static Linux (musl) SDK can't use those system libraries — the SDK ships its own (non‑prefixed) BoringSSL and no libsasl2 — so the package didn't build for musl.This is a constraint fairly specific to this package: unlike a pure‑Swift library, we carry a large C dependency that hard‑links OpenSSL across several files and pulls in libsasl2 for one optional auth mechanism.
Approach
Route librdkafka's
<openssl/.h>usage onto swift-nio-ssl's vendored BoringSSL (CNIOBoringSSL) on all platforms via a small header shim, depending on the publicNIOSSLproduct soCNIOBoringSSLis pulled into the link transitively. librdkafka needs two functions BoringSSL doesn't export (RAND_priv_bytes,SSL_CTX_use_cert_and_key); these are provided as thin shims. TLS/crypto is now self‑contained on every platform (no system OpenSSL), and the package builds with the static musl SDK.Alternatives considered
Reusing the ecosystem's vendored BoringSSL through its public product is the least‑maintenance option, keeps a single uniform build across platforms, and follows a pattern already used by other C‑wrapping Swift libraries.
GSSAPI/Kerberos is now opt‑in (off by default) — behavior change
GSSAPI (Cyrus SASL) is the only SASL mechanism that needs the external system
libsasl2, which a static build can't provide, so it's now opt‑in and off by default.SCRAM,PLAIN, andTLS/mTLSare unaffected and always available.SWIFT_KAFKA_ENABLE_GSSAPI=1(compiles the Cyrus provider and linkslibsasl2; requires the libsasl2 dev headers).This matches the librdkafka‑wrapper ecosystem, where GSSAPI is consistently opt‑in rather than on by default. This is change from the current behavior, where the default build provides GSSAPI.
Verification
KafkaSSLCertLoadingTests) exercise CNIOBoringSSL certificate loading at client creation — PEM (CA/cert/key) and PKCS#12 (which routes through theSSL_CTX_use_cert_and_keyshim) — with negative controls proving the parse paths actually run.KafkaSecurityIntegrationTests) cover TLS transport, mTLS authentication, SASL/SCRAM authentication over TLS, and ACL authorization (allow + deny) against a real broker with SSL/SASL_SSL listeners. They're gated onKAFKA_SSL_PORTand skip when no secure broker is present, so plaintext/CI runs are unaffected.Follow‑ups