()
| 360 | |
| 361 | #[test] |
| 362 | fn test_cert_store_builder() { |
| 363 | let data = make_test_cert_data(); |
| 364 | |
| 365 | // Use builder - domain is base domain (e.g., "example.com") |
| 366 | // All gateway certs are wildcard certs |
| 367 | let mut builder = CertStoreBuilder::new(); |
| 368 | builder |
| 369 | .add_cert("example.com", &data) |
| 370 | .expect("failed to add cert"); |
| 371 | |
| 372 | let store = builder.build(); |
| 373 | |
| 374 | // Check it's loaded (stored by base domain) |
| 375 | assert!(store.has_cert("example.com")); |
| 376 | assert_eq!(store.list_domains().len(), 1); |
| 377 | |
| 378 | // Should resolve any subdomain via wildcard matching |
| 379 | assert!(store.has_cert_for_sni("test.example.com")); |
| 380 | assert!(store.has_cert_for_sni("foo.example.com")); |
| 381 | |
| 382 | // Should not resolve exact base domain (wildcard doesn't match base) |
| 383 | assert!(!store.has_cert_for_sni("example.com")); |
| 384 | |
| 385 | // Should not resolve different domain |
| 386 | assert!(!store.has_cert_for_sni("example.org")); |
| 387 | } |
| 388 | |
| 389 | #[test] |
| 390 | fn test_cert_store_wildcard() { |
nothing calls this directly
no test coverage detected