diff options
author | David Shaw <[email protected]> | 2005-02-12 03:15:02 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2005-02-12 03:15:02 +0000 |
commit | 2833a0eadcc5e95d164974afddb421afcff3bca9 (patch) | |
tree | f18c33d1f4b9d4eb1da58d26cea832515fba3c81 /keyserver/gpgkeys_curl.c | |
parent | * curl-shim.h, curl-shim.c: New. This is code to fake the curl API in (diff) | |
download | gnupg-2833a0eadcc5e95d164974afddb421afcff3bca9.tar.gz gnupg-2833a0eadcc5e95d164974afddb421afcff3bca9.zip |
* curl-shim.c (curl_easy_perform): Fix compile warning.
* curl-shim.h, gpgkeys_curl.c (main), gpgkeys_ldap.c (main): Add
ca-cert-file option, to pass in the SSL cert.
Diffstat (limited to '')
-rw-r--r-- | keyserver/gpgkeys_curl.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/keyserver/gpgkeys_curl.c b/keyserver/gpgkeys_curl.c index 7c3dcb3c7..c2d51f2ee 100644 --- a/keyserver/gpgkeys_curl.c +++ b/keyserver/gpgkeys_curl.c @@ -158,6 +158,7 @@ main(int argc,char *argv[]) char *thekey=NULL; unsigned int timeout=DEFAULT_KEYSERVER_TIMEOUT; long follow_redirects=5,debug=0,check_cert=1; + char *ca_cert_file=NULL; console=stderr; @@ -344,6 +345,26 @@ main(int argc,char *argv[]) else check_cert=1; } + else if(strncasecmp(start,"ca-cert-file",12)==0) + { + if(no) + { + free(ca_cert_file); + ca_cert_file=NULL; + } + else if(start[12]=='=') + { + free(ca_cert_file); + ca_cert_file=strdup(&start[13]); + if(!ca_cert_file) + { + fprintf(console,"gpgkeys: out of memory while creating " + "ca_cert_file\n"); + ret=KEYSERVER_NO_MEMORY; + goto fail; + } + } + } continue; } @@ -406,6 +427,9 @@ main(int argc,char *argv[]) curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,check_cert); + if(ca_cert_file) + curl_easy_setopt(curl,CURLOPT_CAINFO,ca_cert_file); + if(proxy[0]) curl_easy_setopt(curl,CURLOPT_PROXY,proxy); |