| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "OSSL_HTTP_PARSE_URL 3SSL" |
| 58 |
.TH OSSL_HTTP_PARSE_URL 3SSL 2026-04-07 3.6.2 OpenSSL |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
OSSL_HTTP_adapt_proxy, |
| 65 |
OSSL_parse_url, |
| 66 |
OSSL_HTTP_parse_url, |
| 67 |
OCSP_parse_url |
| 68 |
\&\- http utility functions |
| 69 |
.SH SYNOPSIS |
| 70 |
.IX Header "SYNOPSIS" |
| 71 |
.Vb 1 |
| 72 |
\& #include <openssl/http.h> |
| 73 |
\& |
| 74 |
\& const char *OSSL_HTTP_adapt_proxy(const char *proxy, const char *no_proxy, |
| 75 |
\& const char *server, int use_ssl); |
| 76 |
\& |
| 77 |
\& int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost, |
| 78 |
\& char **pport, int *pport_num, |
| 79 |
\& char **ppath, char **pquery, char **pfrag); |
| 80 |
\& int OSSL_HTTP_parse_url(const char *url, |
| 81 |
\& int *pssl, char **puser, char **phost, |
| 82 |
\& char **pport, int *pport_num, |
| 83 |
\& char **ppath, char **pquery, char **pfrag); |
| 84 |
.Ve |
| 85 |
.PP |
| 86 |
The following functions have been deprecated since OpenSSL 3.0, and can be |
| 87 |
hidden entirely by defining \fBOPENSSL_API_COMPAT\fR with a suitable version value, |
| 88 |
see \fBopenssl_user_macros\fR\|(7): |
| 89 |
.PP |
| 90 |
.Vb 2 |
| 91 |
\& int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath, |
| 92 |
\& int *pssl); |
| 93 |
.Ve |
| 94 |
.SH DESCRIPTION |
| 95 |
.IX Header "DESCRIPTION" |
| 96 |
\&\fBOSSL_HTTP_adapt_proxy()\fR takes an optional proxy hostname \fIproxy\fR |
| 97 |
and returns it transformed according to the optional \fIno_proxy\fR parameter, |
| 98 |
\&\fIserver\fR, \fIuse_ssl\fR, and the applicable environment variable, as follows. |
| 99 |
If \fIproxy\fR is NULL, take any default value from the \f(CW\*(C`http_proxy\*(C'\fR |
| 100 |
environment variable, or from \f(CW\*(C`https_proxy\*(C'\fR if \fIuse_ssl\fR is nonzero. |
| 101 |
If this still does not yield a proxy hostname, |
| 102 |
take any further default value from the \f(CW\*(C`HTTP_PROXY\*(C'\fR |
| 103 |
environment variable, or from \f(CW\*(C`HTTPS_PROXY\*(C'\fR if \fIuse_ssl\fR is nonzero. |
| 104 |
If \fIno_proxy\fR is NULL, take any default exclusion value from the \f(CW\*(C`no_proxy\*(C'\fR |
| 105 |
environment variable, or else from \f(CW\*(C`NO_PROXY\*(C'\fR. |
| 106 |
Return the determined proxy host unless the exclusion value, |
| 107 |
which is a list of proxy hosts separated by \f(CW\*(C`,\*(C'\fR and/or whitespace, |
| 108 |
contains \fIserver\fR. |
| 109 |
Otherwise return NULL. |
| 110 |
When \fIserver\fR is a string delimited by \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR, which are used for IPv6 |
| 111 |
addresses, the enclosing \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR are stripped prior to comparison. |
| 112 |
.PP |
| 113 |
\&\fBOSSL_parse_url()\fR parses its input string \fIurl\fR as a URL of the form |
| 114 |
\&\f(CW\*(C`[scheme://][userinfo@]host[:port][/path][?query][#fragment]\*(C'\fR and splits it up |
| 115 |
into scheme, userinfo, host, port, path, query, and fragment components. |
| 116 |
The host (or server) component may be a DNS name or an IP address |
| 117 |
where IPv6 addresses must be enclosed in square brackets \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR. |
| 118 |
The port component is optional and defaults to \f(CW0\fR. |
| 119 |
If given, it must be in decimal form. If the \fIpport_num\fR argument is not NULL |
| 120 |
the integer value of the port number is assigned to \fI*pport_num\fR on success. |
| 121 |
The path component is also optional and defaults to \f(CW\*(C`/\*(C'\fR. |
| 122 |
Each non-NULL result pointer argument \fIpscheme\fR, \fIpuser\fR, \fIphost\fR, \fIpport\fR, |
| 123 |
\&\fIppath\fR, \fIpquery\fR, and \fIpfrag\fR, is assigned the respective url component. |
| 124 |
Any IPv6 address in \fI*phost\fR is enclosed in \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR. |
| 125 |
On success, they are guaranteed to contain non-NULL string pointers, else NULL. |
| 126 |
It is the responsibility of the caller to free them using \fBOPENSSL_free\fR\|(3). |
| 127 |
If \fIpquery\fR is NULL, any given query component is handled as part of the path. |
| 128 |
A string returned via \fI*ppath\fR is guaranteed to begin with a \f(CW\*(C`/\*(C'\fR character. |
| 129 |
For absent scheme, userinfo, port, query, and fragment components |
| 130 |
an empty string is provided. |
| 131 |
.PP |
| 132 |
\&\fBOSSL_HTTP_parse_url()\fR is a special form of \fBOSSL_parse_url()\fR |
| 133 |
where the scheme, if given, must be \f(CW\*(C`http\*(C'\fR or \f(CW\*(C`https\*(C'\fR. |
| 134 |
If \fIpssl\fR is not NULL, \fI*pssl\fR is assigned 1 in case parsing was successful |
| 135 |
and the scheme is \f(CW\*(C`https\*(C'\fR, else 0. |
| 136 |
The port component is optional and defaults to \f(CW443\fR if the scheme is \f(CW\*(C`https\*(C'\fR, |
| 137 |
else \f(CW80\fR. |
| 138 |
Note that relative paths must be given with a leading \f(CW\*(C`/\*(C'\fR, |
| 139 |
otherwise the first path element is interpreted as the host. |
| 140 |
.PP |
| 141 |
Calling the deprecated function OCSP_parse_url(url, host, port, path, ssl) |
| 142 |
is equivalent to |
| 143 |
OSSL_HTTP_parse_url(url, ssl, NULL, host, port, NULL, path, NULL, NULL). |
| 144 |
.SH "RETURN VALUES" |
| 145 |
.IX Header "RETURN VALUES" |
| 146 |
\&\fBOSSL_HTTP_adapt_proxy()\fR returns NULL if no proxy is to be used, |
| 147 |
otherwise a constant proxy hostname string, |
| 148 |
which is either the proxy name handed in or an environment variable value. |
| 149 |
.PP |
| 150 |
\&\fBOSSL_parse_url()\fR, \fBOSSL_HTTP_parse_url()\fR, and \fBOCSP_parse_url()\fR |
| 151 |
return 1 on success, 0 on error. |
| 152 |
.SH "SEE ALSO" |
| 153 |
.IX Header "SEE ALSO" |
| 154 |
\&\fBOSSL_HTTP_transfer\fR\|(3) |
| 155 |
.SH HISTORY |
| 156 |
.IX Header "HISTORY" |
| 157 |
\&\fBOSSL_HTTP_adapt_proxy()\fR, |
| 158 |
\&\fBOSSL_parse_url()\fR and \fBOSSL_HTTP_parse_url()\fR were added in OpenSSL 3.0. |
| 159 |
\&\fBOCSP_parse_url()\fR was deprecated in OpenSSL 3.0. |
| 160 |
.SH COPYRIGHT |
| 161 |
.IX Header "COPYRIGHT" |
| 162 |
Copyright 2019\-2022 The OpenSSL Project Authors. All Rights Reserved. |
| 163 |
.PP |
| 164 |
Licensed under the Apache License 2.0 (the "License"). You may not use |
| 165 |
this file except in compliance with the License. You can obtain a copy |
| 166 |
in the file LICENSE in the source distribution or at |
| 167 |
<https://www.openssl.org/source/license.html>. |