Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add http.cainfo config for custom certs #2917

Merged
merged 1 commit into from
Jul 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/cargo/ops/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ pub fn http_handle(config: &Config) -> CargoResult<Easy> {
if let Some(proxy) = try!(http_proxy(config)) {
try!(handle.proxy(&proxy));
}
if let Some(cainfo) = try!(config.get_path("http.cainfo")) {
try!(handle.cainfo(&cainfo.val));
}
if let Some(timeout) = try!(http_timeout(config)) {
try!(handle.connect_timeout(Duration::new(timeout as u64, 0)));
try!(handle.low_speed_time(Duration::new(timeout as u64, 0)));
Expand Down
5 changes: 3 additions & 2 deletions src/doc/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ index = "..." # URL of the registry index (defaults to the central repository)
token = "..." # Access token (found on the central repo’s website)

[http]
proxy = "..." # HTTP proxy to use for HTTP requests (defaults to none)
timeout = 60000 # Timeout for each HTTP request, in milliseconds
proxy = "..." # HTTP proxy to use for HTTP requests (defaults to none)
timeout = 60000 # Timeout for each HTTP request, in milliseconds
cainfo = "cert.pem" # Path to Certificate Authority (CA) bundle (optional)

[build]
jobs = 1 # number of parallel jobs, defaults to # of CPUs
Expand Down