diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-06-12 17:43:15 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2021-06-16 15:36:01 +0200 |
commit | ab9d67efa4c2a4ee6787430a447de675cb78c8e2 (patch) | |
tree | 8a7a336f91247b9f45e13f48980084a4ed2a68ce /apps | |
parent | X509_digest_sig(): Improve default hash for EdDSA and allow to return the cho... (diff) | |
download | openssl-ab9d67efa4c2a4ee6787430a447de675cb78c8e2.tar.xz openssl-ab9d67efa4c2a4ee6787430a447de675cb78c8e2.zip |
HTTP client: fix use of OSSL_HTTP_adapt_proxy(), which is needed also in cmp.c
For this reason, export this function, which allows removing http_local.h
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15764)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/cmp.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/cmp.c b/apps/cmp.c index dfd2981425..7c9256ccb5 100644 --- a/apps/cmp.c +++ b/apps/cmp.c @@ -1765,8 +1765,7 @@ static int setup_client_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine) int portnum, ssl; char server_buf[200] = { '\0' }; char proxy_buf[200] = { '\0' }; - char *proxy_host = NULL; - char *proxy_port_str = NULL; + const char *proxy_host = NULL; if (opt_server == NULL) { CMP_err("missing -server option"); @@ -1795,8 +1794,9 @@ static int setup_client_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine) opt_tls_used ? "s" : "", host, port, *used_path == '/' ? used_path + 1 : used_path); - if (opt_proxy != NULL) - (void)BIO_snprintf(proxy_buf, sizeof(proxy_buf), " via %s", opt_proxy); + proxy_host = OSSL_HTTP_adapt_proxy(opt_proxy, opt_no_proxy, host, ssl); + if (proxy_host != NULL) + (void)BIO_snprintf(proxy_buf, sizeof(proxy_buf), " via %s", proxy_host); if (!transform_opts()) goto err; @@ -1902,8 +1902,6 @@ static int setup_client_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine) OPENSSL_free(host); OPENSSL_free(port); OPENSSL_free(path); - OPENSSL_free(proxy_host); - OPENSSL_free(proxy_port_str); return ret; oom: CMP_err("out of memory"); |