Skip to content

Commit ab6e89c

Browse files
committed
assure ssl_verify is enabled by default, and also affect host verification.
The differentiation between peer and host is done (in `git`) here: https://github.com/git/git/blob/cfb8a6e9a93adbe81efca66e6110c9b4d2e57169/http.c#L980-L987
1 parent dfec281 commit ab6e89c

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

gix-transport/src/client/blocking_io/http/curl/remote.rs

+1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ pub fn new() -> (
196196
}
197197

198198
handle.ssl_verify_peer(ssl_verify)?;
199+
handle.ssl_verify_host(ssl_verify)?;
199200

200201
if let Some(http_version) = http_version {
201202
let version = match http_version {

gix-transport/src/client/blocking_io/http/mod.rs

+24-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub mod options {
120120

121121
/// Options to configure http requests.
122122
// TODO: testing most of these fields requires a lot of effort, unless special flags to introspect ongoing requests are added.
123-
#[derive(Default, Clone)]
123+
#[derive(Clone)]
124124
pub struct Options {
125125
/// Headers to be added to every request.
126126
/// They are applied unconditionally and are expected to be valid as they occur in an HTTP request, like `header: value`, without newlines.
@@ -189,6 +189,29 @@ pub struct Options {
189189
pub backend: Option<Arc<Mutex<dyn Any + Send + Sync + 'static>>>,
190190
}
191191

192+
impl Default for Options {
193+
fn default() -> Self {
194+
Options {
195+
extra_headers: vec![],
196+
follow_redirects: Default::default(),
197+
low_speed_limit_bytes_per_second: 0,
198+
low_speed_time_seconds: 0,
199+
proxy: None,
200+
no_proxy: None,
201+
proxy_auth_method: Default::default(),
202+
proxy_authenticate: None,
203+
user_agent: None,
204+
connect_timeout: None,
205+
verbose: false,
206+
ssl_ca_info: None,
207+
ssl_version: None,
208+
ssl_verify: true,
209+
http_version: None,
210+
backend: None,
211+
}
212+
}
213+
}
214+
192215
/// The actual http client implementation, using curl
193216
#[cfg(feature = "http-client-curl")]
194217
pub type Impl = curl::Curl;

0 commit comments

Comments
 (0)