Skip to content

Commit 086c5e5

Browse files
committed
http: add environment variable for HTTPS proxy.
This commit adds four environment variables that can be used to configure the proxy cert, proxy ssl key, the proxy cert password protected flag, and the CA info for the proxy. Documentation for the options was also updated. Signed-off-by: Jorge Lopez Silva <[email protected]>
1 parent e18b342 commit 086c5e5

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

Documentation/config/http.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,24 @@ http.proxyAuthMethod::
3131

3232
http.proxySSLCert::
3333
The pathname of a file that stores a client certificate to use to authenticate
34-
with an HTTPS proxy.
34+
with an HTTPS proxy. Can be overridden by the `GIT_PROXY_SSL_CERT` environment
35+
variable.
3536

3637
http.proxySSLKey::
3738
The pathname of a file that stores a private key to use to authenticate with
38-
an HTTPS proxy.
39+
an HTTPS proxy. Can be overridden by the `GIT_PROXY_SSL_KEY` environment
40+
variable.
3941

4042
http.proxySSLCertPasswordProtected::
4143
Enable Git's password prompt for the proxy SSL certificate. Otherwise OpenSSL
4244
will prompt the user, possibly many times, if the certificate or private key
43-
is encrypted.
45+
is encrypted. Can be overriden by the `GIT_PROXY_SSL_CERT_PASSWORD_PROTECTED`
46+
environment variable.
4447

4548
http.proxySSLCAInfo::
4649
Pathname to the file containing the certificate bundle that should be used to
47-
verify the proxy with when using an HTTPS proxy.
50+
verify the proxy with when using an HTTPS proxy. Can be overriden by the
51+
`GIT_PROXY_SSL_CAINFO` environment variable.
4852

4953
http.emptyAuth::
5054
Attempt authentication without seeking a username or password. This

http.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,13 @@ void http_init(struct remote *remote, const char *url, int proactive_auth)
12111211
max_requests = DEFAULT_MAX_REQUESTS;
12121212
#endif
12131213

1214+
set_from_env(&http_proxy_ssl_cert, "GIT_PROXY_SSL_CERT");
1215+
set_from_env(&http_proxy_ssl_key, "GIT_PROXY_SSL_KEY");
1216+
set_from_env(&http_proxy_ssl_ca_info, "GIT_PROXY_SSL_CAINFO");
1217+
1218+
if (getenv("GIT_PROXY_SSL_CERT_PASSWORD_PROTECTED"))
1219+
proxy_ssl_cert_password_required = 1;
1220+
12141221
if (getenv("GIT_CURL_FTP_NO_EPSV"))
12151222
curl_ftp_no_epsv = 1;
12161223

0 commit comments

Comments
 (0)