mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
http: Allow overriding of the Host header.
* common/http.c (http_open): Add arg httphost. (http_open_document): Pass NULL for httphost. (send_request): Add arg httphost. If given, use HTTPHOST instead of SERVER. Use https with a proxy if requested. (http_verify_server_credentials): Do not stop at the first error message. * dirmngr/ocsp.c (do_ocsp_request): Adjust call to http_open. * keyserver/curl-shim.c (curl_easy_perform): Ditto. * dirmngr/ks-engine-http.c (ks_http_fetch): Ditto. * dirmngr/ks-engine-hkp.c (ks_hkp_help): Ditto.
This commit is contained in:
parent
25036ec6ab
commit
8b90d79818
7 changed files with 52 additions and 28 deletions
|
@ -765,6 +765,7 @@ send_request (ctrl_t ctrl, const char *request, const char *hostportstr,
|
|||
err = http_open (&http,
|
||||
post_cb? HTTP_REQ_POST : HTTP_REQ_GET,
|
||||
request,
|
||||
NULL,
|
||||
/* fixme: AUTH */ NULL,
|
||||
httpflags,
|
||||
/* fixme: proxy*/ NULL,
|
||||
|
|
|
@ -68,6 +68,7 @@ ks_http_fetch (ctrl_t ctrl, const char *url, estream_t *r_fp)
|
|||
err = http_open (&http,
|
||||
HTTP_REQ_GET,
|
||||
url,
|
||||
/* httphost */ NULL,
|
||||
/* fixme: AUTH */ NULL,
|
||||
0,
|
||||
/* fixme: proxy*/ NULL,
|
||||
|
|
|
@ -165,7 +165,7 @@ do_ocsp_request (ctrl_t ctrl, ksba_ocsp_t ocsp, gcry_md_hd_t md,
|
|||
}
|
||||
|
||||
once_more:
|
||||
err = http_open (&http, HTTP_REQ_POST, url, NULL,
|
||||
err = http_open (&http, HTTP_REQ_POST, url, NULL, NULL,
|
||||
(opt.honor_http_proxy? HTTP_FLAG_TRY_PROXY:0),
|
||||
opt.http_proxy, NULL, NULL, NULL);
|
||||
if (err)
|
||||
|
|
|
@ -298,7 +298,7 @@ skip_options (char *line)
|
|||
}
|
||||
|
||||
|
||||
/* Return an error if the assuan context does not belong to teh owner
|
||||
/* Return an error if the assuan context does not belong to the owner
|
||||
of the process or to root. On error FAILTEXT is set as Assuan
|
||||
error string. */
|
||||
static gpg_error_t
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue