threads / patch / 40859

patchhttp: treat config options sslCAPath and sslCAInfo as paths

Subject: [PATCH] http: treat config options sslCAPath and sslCAInfo as paths

## tl;dr

2 messages between Nov 23, 2015 and Nov 24, 2015. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

charles@hashpling.org· Nov 23, 2015, 12:02 UTC · lore
From: Charles Bailey <cbailey32@bloomberg.net>
This enables ~ and ~user expansion for these config options.
Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
---

In the only place that we (optionally) test https specifically, we also turn off SSL verification so I couldn't see a sensible way to add an automated test.

The change is fairly simple and I've tested manually and the effects are as I expected - I can point to a certificate bundle or directory in my home directory using a ~/ prefix in my .gitconfig.

 http.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to http.c +2 −2
diff --git a/http.c b/http.c
index 42f29ce..5e37252 100644
--- a/http.c
+++ b/http.c
@@ -214,10 +214,10 @@ static int http_options(const char *var, const char *value, void *cb)
 #endif
 #if LIBCURL_VERSION_NUM >= 0x070908
 	if (!strcmp("http.sslcapath", var))
-		return git_config_string(&ssl_capath, var, value);
+		return git_config_pathname(&ssl_capath, var, value);
 #endif
 	if (!strcmp("http.sslcainfo", var))
-		return git_config_string(&ssl_cainfo, var, value);
+		return git_config_pathname(&ssl_cainfo, var, value);
 	if (!strcmp("http.sslcertpasswordprotected", var)) {
 		ssl_cert_password_required = git_config_bool(var, value);
 		return 0;
-- 
2.6.0
Jeff King· Nov 24, 2015, 23:53 UTC · re: charles@hashpling.org · lore

Re: [PATCH] http: treat config options sslCAPath and sslCAInfo as paths

On Mon, Nov 23, 2015 at 12:02:40PM +0000, charles@hashpling.org wrote:
> From: Charles Bailey <cbailey32@bloomberg.net>
> 
> This enables ~ and ~user expansion for these config options.
Thanks, this seems like the obviously correct thing to do.
Show 7 quoted lines
> In the only place that we (optionally) test https specifically, we also
> turn off SSL verification so I couldn't see a sensible way to add an
> automated test.
> 
> The change is fairly simple and I've tested manually and the effects are
> as I expected - I can point to a certificate bundle or directory in my
> home directory using a ~/ prefix in my .gitconfig.

Yeah, I agree that testing such a trivial feature is not worth the infrastructure it would require adding to the test suite.

-Peff

← back to recent threads