mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Dedupe lazy_static
🎉 🎉 🎉
This commit is contained in:
parent
4a6453ac9a
commit
6c6a4159cf
3 changed files with 20 additions and 30 deletions
|
@ -52,12 +52,9 @@ pub type Connector = HttpsConnector;
|
|||
|
||||
pub fn create_ssl_client(ca_file: &PathBuf) -> OpensslClient {
|
||||
let mut ssl_connector_builder = SslConnectorBuilder::new(SslMethod::tls()).unwrap();
|
||||
{
|
||||
let context = ssl_connector_builder.builder_mut();
|
||||
context.set_ca_file(ca_file).expect("could not set CA file");
|
||||
context.set_cipher_list(DEFAULT_CIPHERS).expect("could not set ciphers");
|
||||
context.set_options(SSL_OP_NO_SSLV2 | SSL_OP_NO_SSLV3 | SSL_OP_NO_COMPRESSION);
|
||||
}
|
||||
ssl_connector_builder.set_ca_file(ca_file).expect("could not set CA file");
|
||||
ssl_connector_builder.set_cipher_list(DEFAULT_CIPHERS).expect("could not set ciphers");
|
||||
ssl_connector_builder.set_options(SSL_OP_NO_SSLV2 | SSL_OP_NO_SSLV3 | SSL_OP_NO_COMPRESSION);
|
||||
let ssl_connector = ssl_connector_builder.build();
|
||||
OpensslClient::from(ssl_connector)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue