Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pingora-core/src/upstreams/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,17 @@ impl HttpPeer {
}
}

/// Create a new [`HttpPeer`] with client certificate and key for mutual TLS.
pub fn new_mtls<A: ToInetSocketAddrs>(
address: A,
sni: String,
client_cert_key: Arc<CertKey>,
) -> Self {
let mut peer = Self::new(address, true, sni);
peer.client_cert_key = Some(client_cert_key);
peer
}

fn peer_hash(&self) -> u64 {
let mut hasher = AHasher::default();
self.hash(&mut hasher);
Expand Down
Loading