mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add command-line argument to use a custom SSL certificate database.
This commit is contained in:
parent
d7fb2cc27f
commit
dc99104f55
7 changed files with 36 additions and 13 deletions
|
@ -7,16 +7,12 @@ use hyper::net::HttpsConnector;
|
|||
use hyper_openssl::OpensslClient;
|
||||
use openssl::ssl::{SSL_OP_NO_COMPRESSION, SSL_OP_NO_SSLV2, SSL_OP_NO_SSLV3};
|
||||
use openssl::ssl::{SslConnectorBuilder, SslMethod};
|
||||
use servo_config::resource_files::resources_dir_path;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub type Connector = HttpsConnector<OpensslClient>;
|
||||
|
||||
pub fn create_ssl_client(certificate_file: &str) -> OpensslClient {
|
||||
let ca_file = &resources_dir_path()
|
||||
.expect("Need certificate file to make network requests")
|
||||
.join(certificate_file);
|
||||
|
||||
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue