[−][src]Struct security_framework::secure_transport::ClientBuilder
pub struct ClientBuilder { /* fields omitted */ }
A builder type to simplify the creation of client side SslStream
s.
Methods
impl ClientBuilder
[src]
impl ClientBuilder
pub fn new() -> Self
[src]
pub fn new() -> Self
Creates a new builder with default options.
pub fn anchor_certificates(&mut self, certs: &[SecCertificate]) -> &mut Self
[src]
pub fn anchor_certificates(&mut self, certs: &[SecCertificate]) -> &mut Self
Specifies the set of root certificates to trust when verifying the server's certificate.
pub fn trust_anchor_certificates_only(&mut self, only: bool) -> &mut Self
[src]
pub fn trust_anchor_certificates_only(&mut self, only: bool) -> &mut Self
Specifies whether to trust the built-in certificates in addition to specified anchor certificates.
pub fn whitelist_ciphers(
&mut self,
whitelisted_ciphers: &[CipherSuite]
) -> &mut Self
[src]
pub fn whitelist_ciphers(
&mut self,
whitelisted_ciphers: &[CipherSuite]
) -> &mut Self
Set a whitelist of enabled ciphers. Any ciphers not whitelisted will be disabled.
pub fn blacklist_ciphers(
&mut self,
blacklisted_ciphers: &[CipherSuite]
) -> &mut Self
[src]
pub fn blacklist_ciphers(
&mut self,
blacklisted_ciphers: &[CipherSuite]
) -> &mut Self
Set a blacklist of disabled ciphers. Blacklisted ciphers will be disabled.
pub fn identity(
&mut self,
identity: &SecIdentity,
chain: &[SecCertificate]
) -> &mut Self
[src]
pub fn identity(
&mut self,
identity: &SecIdentity,
chain: &[SecCertificate]
) -> &mut Self
Use the specified identity as a SSL/TLS client certificate.
pub fn protocol_min(&mut self, min: SslProtocol) -> &mut Self
[src]
pub fn protocol_min(&mut self, min: SslProtocol) -> &mut Self
Configure the minimum protocol that this client will support.
Requires the OSX_10_8
(or greater) feature.
pub fn protocol_max(&mut self, max: SslProtocol) -> &mut Self
[src]
pub fn protocol_max(&mut self, max: SslProtocol) -> &mut Self
Configure the minimum protocol that this client will support.
Requires the OSX_10_8
(or greater) feature.
pub fn handshake<S>(&self, domain: &str, stream: S) -> Result<SslStream<S>> where
S: Read + Write,
[src]
pub fn handshake<S>(&self, domain: &str, stream: S) -> Result<SslStream<S>> where
S: Read + Write,
Initiates a new SSL/TLS session over a stream connected to the specified domain.
Note that this method assumes that the stream S
is in blocking mode,
and it will return an error if the stream is set to nonblocking mode.
If the stream S
is in asynchronous operation (or may be) then you may
use handshake2
instead.
Note that this method will likely be removed in the next major release
in favor of handshake2
.
pub fn handshake2<S>(
self,
domain: &str,
stream: S
) -> Result<SslStream<S>, ClientHandshakeError<S>> where
S: Read + Write,
[src]
pub fn handshake2<S>(
self,
domain: &str,
stream: S
) -> Result<SslStream<S>, ClientHandshakeError<S>> where
S: Read + Write,
Initiates a new SSL/TLS session over a stream connected to the specified domain.
pub fn danger_handshake_without_providing_domain_for_certificate_validation_and_server_name_indication<S>(
self,
stream: S
) -> Result<SslStream<S>, ClientHandshakeError<S>> where
S: Read + Write,
[src]
pub fn danger_handshake_without_providing_domain_for_certificate_validation_and_server_name_indication<S>(
self,
stream: S
) -> Result<SslStream<S>, ClientHandshakeError<S>> where
S: Read + Write,
Initiates a new SSL/TLS session over a stream without providing a domain.
Warning
You should think very carefully before using this method. If hostname verification is not used, any valid certificate for any site will be trusted for use from any other. This introduces a significant vulnerability to man-in-the-middle attacks.
Trait Implementations
impl Debug for ClientBuilder
[src]
impl Debug for ClientBuilder
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for ClientBuilder
[src]
impl Default for ClientBuilder
fn default() -> ClientBuilder
[src]
fn default() -> ClientBuilder
Returns the "default value" for a type. Read more
Auto Trait Implementations
impl Send for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Sync for ClientBuilder
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more