Repository navigation
fix(ra-rpc): verify TLS key possession for attested servers - #1522
Merged
Merged
Conversation
Signed-off-by: Kevin Wang <wy721@qq.com>
This was referenced Nov 7, 2026
Signed-off-by: Kevin Wang <wy721@qq.com>
…tion Signed-off-by: Kevin Wang <wy721@qq.com>
Signed-off-by: Kevin Wang <wy721@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RA-TLS checks server attestation after the HTTP response. Reqwest's Rustls no-verifier also skips TLS handshake signatures, allowing a copied certificate to pass a later identity check without proving possession of its private key.
Keep the TLS adapter in
client/tls.rs, delegate handshake signatures to rustls, and reuse the existing test PKI. Renametls_no_checktotls_skip_ca_verificationthroughout callers; the default remains false. This skips CA-based certificate checks (trust chain, hostname, validity), not TLS key-possession checks. Client certificate authentication and separately configured attestation verification remain intact.The regression server presents the pinned certificate but signs with a different key. Both TLS 1.2 and 1.3 accept it before the fix and reject it afterward; matching-key controls and CA-issued mTLS clients still work. The fix is independent of #1517's root rotation and temporary-CA removal.
Validation: 219 tests across ra-rpc, cert-client, KMS and dstack-util passed, as did strict Clippy, formatting, and REUSE. Linux x86_64, Rust 1.92.0, reqwest 0.13.4 / rustls 0.23.46,
--all-features --locked --offline; loopback TCP, generated P-256 PKI, exact certificate pin, CA-issued client certificates, TLS 1.2 and 1.3. No hardware TEE or live deployment was used.