diff options
| author | Steven Fackler <[email protected]> | 2016-10-30 14:26:28 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-10-30 14:26:28 -0700 |
| commit | 43b430e5b0723784862fb090ef091bc404542989 (patch) | |
| tree | dca400888bfabd951c4ad348fa08963ad3df21e3 /openssl/src/ssl/connector.rs | |
| parent | Merge pull request #503 from sfackler/ecdhe (diff) | |
| download | rust-openssl-43b430e5b0723784862fb090ef091bc404542989.tar.xz rust-openssl-43b430e5b0723784862fb090ef091bc404542989.zip | |
Pass SslMethod into constructors
Diffstat (limited to 'openssl/src/ssl/connector.rs')
| -rw-r--r-- | openssl/src/ssl/connector.rs | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/openssl/src/ssl/connector.rs b/openssl/src/ssl/connector.rs index 0ec6526e..794523bb 100644 --- a/openssl/src/ssl/connector.rs +++ b/openssl/src/ssl/connector.rs @@ -47,11 +47,7 @@ impl ClientConnectorBuilder { /// Creates a new builder for TLS connections. /// /// The default configuration is based off of libcurl's and is subject to change. - pub fn tls() -> Result<ClientConnectorBuilder, ErrorStack> { - ClientConnectorBuilder::new(SslMethod::tls()) - } - - fn new(method: SslMethod) -> Result<ClientConnectorBuilder, ErrorStack> { + pub fn new(method: SslMethod) -> Result<ClientConnectorBuilder, ErrorStack> { let mut ctx = try!(ctx(method)); try!(ctx.set_default_verify_paths()); try!(ctx.set_cipher_list("ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH")); @@ -107,24 +103,14 @@ impl ServerConnectorBuilder { /// /// The default configuration is based off of the intermediate profile of Mozilla's server side /// TLS configuration recommendations, and is subject to change. - pub fn tls<I>(private_key: &PKeyRef, + pub fn new<I>(method: SslMethod, + private_key: &PKeyRef, certificate: &X509Ref, chain: I) -> Result<ServerConnectorBuilder, ErrorStack> where I: IntoIterator, I::Item: AsRef<X509Ref> { - ServerConnectorBuilder::new(SslMethod::tls(), private_key, certificate, chain) - } - - fn new<I>(method: SslMethod, - private_key: &PKeyRef, - certificate: &X509Ref, - chain: I) - -> Result<ServerConnectorBuilder, ErrorStack> - where I: IntoIterator, - I::Item: AsRef<X509Ref> - { let mut ctx = try!(ctx(method)); ctx.set_options(ssl::SSL_OP_SINGLE_DH_USE | ssl::SSL_OP_SINGLE_ECDH_USE | ssl::SSL_OP_CIPHER_SERVER_PREFERENCE); |