xref: /freebsd/secure/lib/libcrypto/man/man3/OSSL_HTTP_parse_url.3 (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "OSSL_HTTP_PARSE_URL 3ossl"
OSSL_HTTP_PARSE_URL 3ossl "2023-09-19" "3.0.11" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
OSSL_HTTP_adapt_proxy, OSSL_parse_url, OSSL_HTTP_parse_url, OCSP_parse_url \- http utility functions
"SYNOPSIS"
Header "SYNOPSIS" .Vb 1 #include <openssl/http.h> \& const char *OSSL_HTTP_adapt_proxy(const char *proxy, const char *no_proxy, const char *server, int use_ssl); \& int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost, char **pport, int *pport_num, char **ppath, char **pquery, char **pfrag); int OSSL_HTTP_parse_url(const char *url, int *pssl, char **puser, char **phost, char **pport, int *pport_num, char **ppath, char **pquery, char **pfrag); .Ve

The following functions have been deprecated since OpenSSL 3.0, and can be hidden entirely by defining \s-1OPENSSL_API_COMPAT\s0 with a suitable version value, see openssl_user_macros\|(7):

.Vb 2 int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath, int *pssl); .Ve

"DESCRIPTION"
Header "DESCRIPTION" \fBOSSL_HTTP_adapt_proxy() takes an optional proxy hostname proxy and returns it transformed according to the optional no_proxy parameter, \fIserver, use_ssl, and the applicable environment variable, as follows. If proxy is \s-1NULL,\s0 take any default value from the \*(C`http_proxy\*(C' environment variable, or from \*(C`https_proxy\*(C' if use_ssl is nonzero. If this still does not yield a proxy hostname, take any further default value from the \*(C`HTTP_PROXY\*(C' environment variable, or from \*(C`HTTPS_PROXY\*(C' if use_ssl is nonzero. If no_proxy is \s-1NULL,\s0 take any default exclusion value from the \*(C`no_proxy\*(C' environment variable, or else from \*(C`NO_PROXY\*(C'. Return the determined proxy hostname unless the exclusion contains server. Otherwise return \s-1NULL.\s0

\fBOSSL_parse_url() parses its input string url as a \s-1URL\s0 of the form \f(CW\*(C`[scheme://][userinfo@]host[:port][/path][?query][#fragment]\*(C' and splits it up into scheme, userinfo, host, port, path, query, and fragment components. The host (or server) component may be a \s-1DNS\s0 name or an \s-1IP\s0 address where IPv6 addresses should be enclosed in square brackets \*(C`[\*(C' and \*(C`]\*(C'. The port component is optional and defaults to 0. If given, it must be in decimal form. If the pport_num argument is not \s-1NULL\s0 the integer value of the port number is assigned to *pport_num on success. The path component is also optional and defaults to \*(C`/\*(C'. Each non-NULL result pointer argument pscheme, puser, phost, pport, \fIppath, pquery, and pfrag, is assigned the respective url component. On success, they are guaranteed to contain non-NULL string pointers, else \s-1NULL.\s0 It is the responsibility of the caller to free them using OPENSSL_free\|(3). If pquery is \s-1NULL,\s0 any given query component is handled as part of the path. A string returned via *ppath is guaranteed to begin with a \*(C`/\*(C' character. For absent scheme, userinfo, port, query, and fragment components an empty string is provided.

\fBOSSL_HTTP_parse_url() is a special form of OSSL_parse_url() where the scheme, if given, must be \*(C`http\*(C' or \*(C`https\*(C'. If pssl is not \s-1NULL,\s0 *pssl is assigned 1 in case parsing was successful and the scheme is \*(C`https\*(C', else 0. The port component is optional and defaults to 443 if the scheme is \*(C`https\*(C', else 80. Note that relative paths must be given with a leading \*(C`/\*(C', otherwise the first path element is interpreted as the hostname.

Calling the deprecated function OCSP_parse_url(url, host, port, path, ssl) is equivalent to OSSL_HTTP_parse_url(url, ssl, \s-1NULL,\s0 host, port, \s-1NULL,\s0 path, \s-1NULL, NULL\s0).

"RETURN VALUES"
Header "RETURN VALUES" \fBOSSL_HTTP_adapt_proxy() returns \s-1NULL\s0 if no proxy is to be used, otherwise a constant proxy hostname string, which is either the proxy name handed in or an environment variable value.

\fBOSSL_parse_url(), OSSL_HTTP_parse_url(), and OCSP_parse_url() return 1 on success, 0 on error.

"SEE ALSO"
Header "SEE ALSO" \fBOSSL_HTTP_transfer\|(3)
"HISTORY"
Header "HISTORY" \fBOSSL_HTTP_adapt_proxy(), \fBOSSL_parse_url() and OSSL_HTTP_parse_url() were added in OpenSSL 3.0. \fBOCSP_parse_url() was deprecated in OpenSSL 3.0.
"COPYRIGHT"
Header "COPYRIGHT" Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use this file except in compliance with the License. You can obtain a copy in the file \s-1LICENSE\s0 in the source distribution or at <https://www.openssl.org/source/license.html>.