summaryrefslogtreecommitdiffstats
path: root/apps/ocsp.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2021-01-28 22:10:47 +0100
committerDr. David von Oheimb <dev@ddvo.net>2021-03-01 10:30:43 +0100
commit7932982b88f5095f60397fe727d27ddf7234f4d6 (patch)
tree791fa288ead387d06147ae627169996e093c115d /apps/ocsp.c
parente60e974414a7e637ff2f946dc2aa24c381a32cc2 (diff)
OSSL_HTTP_parse_url(): Handle any userinfo, query, and fragment components
Now handle [http[s]://][userinfo@]host[:port][/path][?query][#frag] by optionally providing any userinfo, query, and frag components. All usages of this function, which are client-only, silently ignore userinfo and frag components, while the query component is taken as part of the path. Update and extend the unit tests and all affected documentation. Document and deprecat OCSP_parse_url(). Fixes an issue that came up when discussing FR #14001. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14009)
Diffstat (limited to 'apps/ocsp.c')
-rw-r--r--apps/ocsp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/ocsp.c b/apps/ocsp.c
index 97f9403ff1..e61774a8a3 100644
--- a/apps/ocsp.c
+++ b/apps/ocsp.c
@@ -275,9 +275,10 @@ int ocsp_main(int argc, char **argv)
OPENSSL_free(tport);
OPENSSL_free(tpath);
thost = tport = tpath = NULL;
- if (!OSSL_HTTP_parse_url(opt_arg(),
- &host, &port, NULL, &path, &use_ssl)) {
- BIO_printf(bio_err, "%s Error parsing URL\n", prog);
+ if (!OSSL_HTTP_parse_url(opt_arg(), &use_ssl, NULL /* userinfo */,
+ &host, &port, NULL /* port_num */,
+ &path, NULL /* qry */, NULL /* frag */)) {
+ BIO_printf(bio_err, "%s Error parsing -url argument\n", prog);
goto end;
}
thost = host;