diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-05-28 09:21:29 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-05-28 09:21:29 +0000 |
commit | 59c11b82d55b6e8110f2232f0fd47068e4072495 (patch) | |
tree | a5c684acecf09ad70e05ec653f690f8136c37e4e /src | |
parent | 98871d1e9e0234cc9431dbea08ef1915cb131ee8 (diff) |
Cris Bailiff's CAPATH support added
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c index 606b9e341..9254e941b 100644 --- a/src/main.c +++ b/src/main.c @@ -345,6 +345,7 @@ static void help(void) " --pass <pass> Specifies your passphrase for the private key (HTTPS)"); puts(" --engine <eng> Specifies the crypto engine to use (HTTPS)\n" " --cacert <file> CA certifciate to verify peer against (SSL)\n" + " --capath <directory> CA directory (made using c_rehash) to verify peer against (SSL, NOT Windows)\n" " --ciphers <list> What SSL ciphers to use (SSL)\n" " --connect-timeout <seconds> Maximum time allowed for connection\n" " -f/--fail Fail silently (no output at all) on errors (H)\n" @@ -454,6 +455,7 @@ struct Configurable { char *cert; char *cert_type; char *cacert; + char *capath; char *key; char *key_type; char *key_passwd; @@ -999,6 +1001,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ {"Ed","key-type", TRUE}, {"Ee","pass", TRUE}, {"Ef","engine", TRUE}, + {"Eg","capath ", TRUE}, {"f", "fail", FALSE}, {"F", "form", TRUE}, {"g", "globoff", FALSE}, @@ -1335,6 +1338,10 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ case 'f': /* crypto engine */ GetStr(&config->engine, nextarg); break; + case 'g': /* CA info PEM file */ + /* CA cert directory */ + GetStr(&config->capath, nextarg); + break; default: /* certificate file */ { char *ptr = strchr(nextarg, ':'); @@ -2082,6 +2089,8 @@ void free_config_fields(struct Configurable *config) curl_formfree(config->httppost); if(config->cacert) free(config->cacert); + if(config->capath) + free(config->capath); if(config->cookiejar) free(config->cookiejar); @@ -2558,8 +2567,9 @@ operate(struct Configurable *config, int argc, char *argv[]) curl_easy_setopt(curl, CURLOPT_SSLKEYTYPE, config->key_type); curl_easy_setopt(curl, CURLOPT_SSLKEYPASSWD, config->key_passwd); - if(config->cacert) { - curl_easy_setopt(curl, CURLOPT_CAINFO, config->cacert); + if(config->cacert || config->capath) { + if (config->cacert) curl_easy_setopt(curl, CURLOPT_CAINFO, config->cacert); + if (config->capath) curl_easy_setopt(curl, CURLOPT_CAPATH, config->capath); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, TRUE); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2); } |