History

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

Sebastian Thiel committed 2 years ago

Commit ab6e89c1 parent dfec2812 files · +25 −1Browse files

Unified · Split

2 files
  1. gix-transport/src/client/blocking_io/http/curl/remote.rs +1 −0
  2. gix-transport/src/client/blocking_io/http/mod.rs +24 −1
gix-transport/src/client/blocking_io/http/curl/remote.rs+1−0
@@ -196,6 +196,7 @@ pub fn new() -> ( · 195 unmodified lines
196 }196 }
197 197
198 handle.ssl_verify_peer(ssl_verify)?;198 handle.ssl_verify_peer(ssl_verify)?;
199 handle.ssl_verify_host(ssl_verify)?;
199 200
200 if let Some(http_version) = http_version {201 if let Some(http_version) = http_version {
201 let version = match http_version {202 let version = match http_version {
gix-transport/src/client/blocking_io/http/mod.rs+24−1
@@ -120,7 +120,7 @@ pub mod options { · 119 unmodified lines
120 120
121/// Options to configure http requests.121/// Options to configure http requests.
122// TODO: testing most of these fields requires a lot of effort, unless special flags to introspect ongoing requests are added.122// 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)]
124pub struct Options {124pub struct Options {
125 /// Headers to be added to every request.125 /// Headers to be added to every request.
126 /// They are applied unconditionally and are expected to be valid as they occur in an HTTP request, like `header: value`, without newlines.126 /// 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 { · 62 unmodified lines
189 pub backend: Option<Arc<Mutex<dyn Any + Send + Sync + 'static>>>,189 pub backend: Option<Arc<Mutex<dyn Any + Send + Sync + 'static>>>,
190}190}
191 191
192impl 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
192/// The actual http client implementation, using curl215/// The actual http client implementation, using curl
193#[cfg(feature = "http-client-curl")]216#[cfg(feature = "http-client-curl")]
194pub type Impl = curl::Curl;217pub type Impl = curl::Curl;