[−][src]Struct udp_dtls::DtlsConnectorBuilder
A builder for DtlsConnector
s.
With this builder you can configure the following DTLS properties:
- The identity to be used for client certificate authentication
- Adding and enabling the the DTLS extension 'use_srtp'
- Configuring min/max supported DTLS versions
- Adding a certificate to the set of roots that the connector will trust
- Allowing invalid hostnames/certs for the connection
- Enabling Server Name Indication (SNI)
Methods
impl DtlsConnectorBuilder
[src]
pub fn identity(&mut self, identity: Identity) -> &mut DtlsConnectorBuilder
[src]
Sets the identity to be used for client certificate authentication.
pub fn min_protocol_version(
&mut self,
protocol: Option<Protocol>
) -> &mut DtlsConnectorBuilder
[src]
&mut self,
protocol: Option<Protocol>
) -> &mut DtlsConnectorBuilder
Sets the minimum supported protocol version.
A value of None
enables support for the oldest protocols supported by the implementation.
Defaults to Some(Protocol::Dtlsv10)
.
Underlying SSL
This will be used for setting the ssl options witch corresponds to SSL_CTX_set_options
.
pub fn max_protocol_version(
&mut self,
protocol: Option<Protocol>
) -> &mut DtlsConnectorBuilder
[src]
&mut self,
protocol: Option<Protocol>
) -> &mut DtlsConnectorBuilder
Sets the maximum supported protocol version.
A value of None
enables support for the newest protocols supported by the implementation.
Defaults to None
.
Underlying SSL
This will be used for setting the ssl options witch corresponds to SSL_CTX_set_options
.
pub fn add_srtp_profile(
&mut self,
profile: SrtpProfile
) -> &mut DtlsConnectorBuilder
[src]
&mut self,
profile: SrtpProfile
) -> &mut DtlsConnectorBuilder
Enables the DTLS extension 'use_srtp' as defined in RFC5764.
Underlying SSL
This corresponds to SSL_CTX_set_tlsext_use_srtp
.
pub fn add_root_certificate(
&mut self,
cert: Certificate
) -> &mut DtlsConnectorBuilder
[src]
&mut self,
cert: Certificate
) -> &mut DtlsConnectorBuilder
Adds a certificate to the set of roots that the connector will trust.
The connector will use the system's trust root by default. This method can be used to add to that set when communicating with servers not trusted by the system.
Defaults to an empty set.
Underlying SSL
This will add a certificate to the certificate store. X509_STORE_add_cert
.
pub fn danger_accept_invalid_certs(
&mut self,
accept_invalid_certs: bool
) -> &mut DtlsConnectorBuilder
[src]
&mut self,
accept_invalid_certs: bool
) -> &mut DtlsConnectorBuilder
Controls the use of certificate validation.
Defaults to false
.
Warning
You should think very carefully before using this method. If invalid certificates are trusted, any certificate for any site will be trusted for use. This includes expired certificates. This introduces significant vulnerabilities, and should only be used as a last resort.
pub fn use_sni(&mut self, use_sni: bool) -> &mut DtlsConnectorBuilder
[src]
Controls the use of Server Name Indication (SNI).
Defaults to true
.
pub fn danger_accept_invalid_hostnames(
&mut self,
accept_invalid_hostnames: bool
) -> &mut DtlsConnectorBuilder
[src]
&mut self,
accept_invalid_hostnames: bool
) -> &mut DtlsConnectorBuilder
Controls the use of hostname verification.
Defaults to false
.
Warning
You should think very carefully before using this method. If invalid hostnames are trusted, any valid certificate for any site will be trusted for use. This introduces significant vulnerabilities, and should only be used as a last resort.
pub fn build(&self) -> Result<DtlsConnector>
[src]
Creates a new DtlsConnector
with the settings from this builder.
Auto Trait Implementations
impl Send for DtlsConnectorBuilder
impl Sync for DtlsConnectorBuilder
impl Unpin for DtlsConnectorBuilder
impl UnwindSafe for DtlsConnectorBuilder
impl RefUnwindSafe for DtlsConnectorBuilder
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,