pub enum CertificateConfig {
Strict,
AcceptAll,
Pinned(Vec<CertificatePinning>),
}Expand description
Certificate validation configuration.
Controls how the TLS/SSH host-key certificate check is handled during a
network git operation. The default is CertificateConfig::Strict, which
defers to libgit2’s built-in validation against the system trust store and
rejects on certificate failure. This is the only acceptable mode for
untrusted or forge-facing fetches (the merge gate’s PR-head fetch, P2P
distribution, etc.).
AcceptAll is an explicit, insecure opt-in reserved for tests/operator
bootstrapping where the transport is otherwise authenticated. It must never
be the default for a code path that fetches from an untrusted origin.
Variants§
Strict
Strict validation: defer to libgit2’s built-in certificate verification
(system CA store for HTTPS, known_hosts for SSH) and reject on
failure. This is the secure default.
Implemented by returning git2::CertificateCheckStatus::CertificatePassthrough
from the certificate callback, which signals “no application decision —
use libgit2’s result”. libgit2 then applies its strict default: an
untrusted CA, expired leaf, or hostname mismatch fails the fetch.
AcceptAll
Accept every certificate without validation. Insecure.
Explicit opt-in only. Appropriate for unit tests against a local self-signed server, or operator bootstrapping over an already-trusted transport. The untrusted/forge default must never select this mode.
Pinned(Vec<CertificatePinning>)
Custom validation against a set of pinned host fingerprints.
Trait Implementations§
Source§impl Clone for CertificateConfig
impl Clone for CertificateConfig
Source§fn clone(&self) -> CertificateConfig
fn clone(&self) -> CertificateConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CertificateConfig
impl Debug for CertificateConfig
Source§impl Default for CertificateConfig
impl Default for CertificateConfig
Source§fn default() -> CertificateConfig
fn default() -> CertificateConfig
Auto Trait Implementations§
impl Freeze for CertificateConfig
impl RefUnwindSafe for CertificateConfig
impl Send for CertificateConfig
impl Sync for CertificateConfig
impl Unpin for CertificateConfig
impl UnsafeUnpin for CertificateConfig
impl UnwindSafe for CertificateConfig
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more