()
| 898 | |
| 899 | #[test] |
| 900 | fn mtls_rejects_invalid_pem_blob() { |
| 901 | let tmp = tempfile::tempdir().unwrap(); |
| 902 | let cert = tmp.path().join("cert.pem"); |
| 903 | let key = tmp.path().join("key.pem"); |
| 904 | std::fs::write(&cert, b"not a pem").unwrap(); |
| 905 | std::fs::write(&key, b"also not a pem").unwrap(); |
| 906 | |
| 907 | let cfg = RemoteGitBackendConfig::new("http://localhost", "r") |
| 908 | .client_cert_pem(&cert) |
| 909 | .client_key_pem(&key); |
| 910 | let err = RemoteGitBackend::new(cfg).unwrap_err(); |
| 911 | let msg = err.to_string(); |
| 912 | assert!( |
| 913 | msg.contains("PEM"), |
| 914 | "PEM-parse failure must surface clearly, got: {}", |
| 915 | msg |
| 916 | ); |
| 917 | assert!( |
| 918 | msg.contains(cert.to_str().unwrap()), |
| 919 | "error must include the cert path for debugging, got: {}", |
| 920 | msg |
| 921 | ); |
| 922 | } |
| 923 | |
| 924 | #[test] |
| 925 | fn mtls_accepts_self_signed_pair_from_rcgen() { |
nothing calls this directly
no test coverage detected