Skip to content

Commit 369c565

Browse files
AlvenixAbdullah Alyan
authored and
Abdullah Alyan
committed
Feat: Add verify_ssl field to gix-transport Options which is used to disable SSL verification.
Currently this option only works in the curl backend.
1 parent 5d8b5f4 commit 369c565

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ pub fn new() -> (
157157
verbose,
158158
ssl_ca_info,
159159
ssl_version,
160+
ssl_verify,
160161
http_version,
161162
backend,
162163
},
@@ -194,6 +195,8 @@ pub fn new() -> (
194195
}
195196
}
196197

198+
handle.ssl_verify_peer(ssl_verify)?;
199+
197200
if let Some(http_version) = http_version {
198201
let version = match http_version {
199202
HttpVersion::V1_1 => curl::easy::HttpVersion::V11,

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

+4
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ pub struct Options {
179179
pub ssl_ca_info: Option<PathBuf>,
180180
/// The SSL version or version range to use, or `None` to let the TLS backend determine which versions are acceptable.
181181
pub ssl_version: Option<SslVersionRangeInclusive>,
182+
/// Controls whether to perform SSL identity verification or not. Turning this off is not recommended and can lead to
183+
/// various security risks. An example where this may be needed is when an internal git server uses a self-signed
184+
/// certificate and the user accepts the associated security risks.
185+
pub ssl_verify: bool,
182186
/// The HTTP version to enforce. If unset, it is implementation defined.
183187
pub http_version: Option<HttpVersion>,
184188
/// Backend specific options, if available.

0 commit comments

Comments
 (0)