pub struct TlsConfig {
pub ca: Vec<u8>,
pub x509_cert: Option<X509Certificate>,
/* private fields */
}Expand description
In order to allow the clients to talk to the
crate::scheduler::Scheduler a default certificate and private
key is included in this crate. The only service endpoints that can
be contacted with this NOBODY identity are
[Scheduler.register] and [Scheduler.recover], as these are the
endpoints that are used to prove ownership of a node, and
returning valid certificates if that proof succeeds.
Fields§
§ca: Vec<u8>§x509_cert: Option<X509Certificate>The device_crt parsed as an x509 certificate. Used to validate the common subject name against the node_id configured on the scheduler.
Implementations§
Source§impl TlsConfig
impl TlsConfig
Sourcepub fn identity(self, cert_pem: Vec<u8>, key_pem: Vec<u8>) -> Self
pub fn identity(self, cert_pem: Vec<u8>, key_pem: Vec<u8>) -> Self
This function is used to upgrade the anonymous NOBODY
configuration to a fully authenticated configuration.
Only non-NOBODY configurations are able to talk to their
nodes. If the TlsConfig is not upgraded, nodes will reply
with handshake failures, and abort the connection attempt.
Sourcepub fn identity_from_path<P: AsRef<Path>>(self, path: P) -> Result<Self>
pub fn identity_from_path<P: AsRef<Path>>(self, path: P) -> Result<Self>
Upgrades the connection using an identity based on a certificate and key from a path.
The path is a directory that contains a client.crt and
a client-key.pem-file which contain respectively the certificate
and private key.
Sourcepub fn ca_certificate(self, ca: Vec<u8>) -> Self
pub fn ca_certificate(self, ca: Vec<u8>) -> Self
This function is mostly used to allow running integration tests against a local mock of the service. It should not be used in production, since the preconfigured CA ensures that only the greenlight production servers can complete a valid handshake.
pub fn client_tls_config(&self) -> ClientTlsConfig
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TlsConfig
impl RefUnwindSafe for TlsConfig
impl Send for TlsConfig
impl Sync for TlsConfig
impl Unpin for TlsConfig
impl UnwindSafe for TlsConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
Source§impl<T> Downcast for T
impl<T> Downcast for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request