Struct security_framework::secure_transport::ClientBuilder
[−]
[src]
pub struct ClientBuilder { /* fields omitted */ }
A builder type to simplify the creation of client side SslStream
s.
Methods
impl ClientBuilder
[src]
fn new() -> Self
Creates a new builder with default options.
fn anchor_certificates(&mut self, certs: &[SecCertificate]) -> &mut Self
Specifies the set of additional root certificates to trust when verifying the server's certificate.
fn identity(&mut self,
identity: &SecIdentity,
chain: &[SecCertificate])
-> &mut Self
identity: &SecIdentity,
chain: &[SecCertificate])
-> &mut Self
Use the specified identity as a SSL/TLS client certificate.
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.
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.
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
.
fn handshake2<S>(self,
domain: &str,
stream: S)
-> Result<SslStream<S>, ClientHandshakeError<S>> where S: Read + Write
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.
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
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 Default for ClientBuilder
[src]
fn default() -> ClientBuilder
Returns the "default value" for a type. Read more