The differentiation between peer and host is done (in `git`) here: https://github.com/git/git/blob/cfb8a6e9a93adbe81efca66e6110c9b4d2e57169/http.c#L980-L987
Unified · Split
| @@ -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 { |
| @@ -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)] |
| 124 | pub struct Options { | 124 | pub 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 | ||
| 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 | |||
| 192 | /// The actual http client implementation, using curl | 215 | /// The actual http client implementation, using curl |
| 193 | #[cfg(feature = "http-client-curl")] | 216 | #[cfg(feature = "http-client-curl")] |
| 194 | pub type Impl = curl::Curl; | 217 | pub type Impl = curl::Curl; |