Skip to content

feat(sdk): add mTLS client identity support - #2947

Merged
fakedev9999 merged 2 commits into
mainfrom
fakedev9999/sdk-client-mtls
Aug 26, 2026
Merged

fakedev9999 merged 2 commits into
mainfrom
fakedev9999/sdk-client-mtls

Conversation

@fakedev9999

@fakedev9999 fakedev9999 commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add explicit async and blocking builder methods for an optional mutual TLS client identity.
  • Pass the identity through the network prover and lazy gRPC channel without reading environment variables or files in the SDK.
  • Keep the existing standard TLS path unchanged when no identity is provided.
  • Reject malformed identities and mutual TLS over a non-HTTPS RPC URL.

Motivation

The SDK should own transport configuration, while each application should own its environment variables, secret files, and startup policy. This lets callers load credentials from their own secret source and inject the certificate and private key explicitly.

Validation

  • cargo +1.98.0 fmt --all -- --check
  • cargo +1.98.0 check -p test-artifacts
  • cargo +1.98.0 clippy --all-features --all-targets -- -D warnings -A incomplete-features
  • cargo +1.98.0 test -p sp1-sdk --features network,blocking --lib, 53 passed

The macOS host cannot link the optional GPU feature because the icicle_* native libraries are unavailable. Pull request CI covers the GPU-linked jobs.

@fakedev9999
fakedev9999 force-pushed the fakedev9999/sdk-client-mtls branch from 9779dfa to d032db6 Compare August 25, 2026 04:06
@fakedev9999
fakedev9999 marked this pull request as ready for review August 25, 2026 04:15
@fakedev9999
fakedev9999 force-pushed the fakedev9999/sdk-client-mtls branch from d032db6 to 0c4318e Compare August 25, 2026 04:21
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor
Test Old New Diff
rust_crypto_rsa_test_pkcs_verify_100 28945954 28998470 0.1814 %
bn_test_bn_test_fq_partial_ord 186343 186343 0.0000 %
bls12_381_tests_test_sqrt_fp_100 801714 820983 2.4035 %
sha_test_sha2_v0_9_9_expected_digest_lte_100_times 1270296 1268510 -0.1406 %
bls12_381_tests_test_bls_add_100 10376534 10376534 0.0000 %
p256_test_recover_rand_lte_100 15748616 15772167 0.1495 %
rustcrypto_bigint_test_bigint_mul_add_residue 1751130 1751130 0.0000 %
bn_test_bn_test_g1_add_neg 299549 299549 0.0000 %
secp256k1_program_test_recover_rand_lte_100 5527829 5547742 0.3602 %
bn_test_bn_test_fq_sqrt_100 804031 804031 0.0000 %
k256_test_verify_rand_lte_100 11706510 11737767 0.2670 %
curve25519_dalek_test_decompressed_expected_value 4358887 4519289 3.6799 %
curve25519_dalek_test_add_then_multiply 2765452 2968959 7.3589 %
curve25519_dalek_ng_test_add_then_multiply 4487735 4563602 1.6905 %
p256_test_recover_high_hash_high_recid 5983812 4628741 -22.6456 %
sha_test_sha2_v0_10_8_expected_digest_lte_100_times 1357751 1360094 0.1726 %
bls12_381_tests_test_inverse_fp2_100 2230063 2230063 0.0000 %
curve25519_dalek_ng_test_zero_msm 125094 125094 0.0000 %
bls12_381_tests_test_inverse_fp_100 1205483 1205483 0.0000 %
curve25519_dalek_test_decompressed_noncanonical 7851 7851 0.0000 %
k256_test_recover_pubkey_infinity 101996 101996 0.0000 %
p256_test_recover_pubkey_infinity 97102 97102 0.0000 %
p256_test_verify_rand_lte_100 11992756 11999746 0.0583 %
secp256k1_program_test_verify_rand_lte_100 17086722 17095098 0.0490 %
k256_test_schnorr_verify 5711428 5716032 0.0806 %
bn_test_bn_test_fq_inverse_100 805631 805631 0.0000 %
sha_test_sha3_expected_digest_lte_100_times 1198957 1198680 -0.0231 %
keccack_test_expected_digest_lte_100 1724651 1719478 -0.2999 %
k256_test_point_ops_edge_cases 32628 32628 0.0000 %
bls12_381_tests_test_bls_double_100 6310230 6310230 0.0000 %
curve25519_dalek_ng_test_zero_mul 107709 107709 0.0000 %
bn_test_bn_test_fr_inverse_100 824131 824131 0.0000 %
curve25519_dalek_ng_test_decompressed_noncanonical 195347 195347 0.0000 %
bn_test_bn_test_g1_msm_edge 411941 411941 0.0000 %
k256_test_recover_rand_lte_100 4564829 4566789 0.0429 %
bls12_381_tests_test_sqrt_fp2_100 1714940 1781888 3.9038 %
k256_test_recover_high_hash_high_recid 2154049 2360058 9.5638 %
secp256k1_program_test_verify_v0_30_0_rand_lte_100 17082822 17107404 0.1439 %
curve25519_dalek_test_ed25519_verify 13353138 13353356 0.0016 %
curve25519_dalek_test_zero_mul 71730 71730 0.0000 %
secp256k1_program_test_recover_v0_30_0_rand_lte_100 5481782 5485862 0.0744 %
sha_test_sha2_v0_10_6_expected_digest_lte_100_times 1355939 1352502 -0.2535 %
bn_test_bn_test_g1_add_100 998839 998825 -0.0014 %
bn_test_bn_test_g1_mul_zero 48333 48333 0.0000 %
curve25519_dalek_test_zero_msm 83313 83313 0.0000 %
bn_test_bn_test_g1_double_100 735518 735518 0.0000 %
rustcrypto_bigint_test_bigint_mul_mod_special 1789627 1789627 0.0000 %
sha_test_sha2_v0_10_9_expected_digest_lte_100_times 1352061 1360136 0.5972 %

@fakedev9999
fakedev9999 merged commit 27db0b2 into main Aug 26, 2026
13 checks passed
@fakedev9999
fakedev9999 deleted the fakedev9999/sdk-client-mtls branch August 26, 2026 05:04
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.

2 participants