summaryrefslogtreecommitdiff
path: root/ext/curl
diff options
context:
space:
mode:
authorAyesh Karunaratne <ayesh@aye.sh>2021-01-18 03:26:25 +0700
committerNikita Popov <nikita.ppv@gmail.com>2021-01-18 10:00:31 +0100
commit3dad63b5b25fc27604a38964b3bea885cbfbf1d3 (patch)
treec661a90744730fa0d2ac945d695a3745c4437087 /ext/curl
parent2d0dd4d08f50e758a601f2199db4a78d9fc58348 (diff)
downloadphp-git-3dad63b5b25fc27604a38964b3bea885cbfbf1d3.tar.gz
Curl: Add CURLOPT_DOH_URL option
From libcurl version 7.62.0 and later, it supports DNS-over-HTTPS with [`CURLOPT_DOH_URL`](https://curl.se/libcurl/c/CURLOPT_DOH_URL.html) option. This adds integration with the `CURLOPT_DOH_URL` option if libcurl version is >= 7.62.0 (0x073E00). For reference, Ubuntu 20.04+ `libcurl4-openssl-dev`-based PHP builds use Curl 7.68. Closes GH-6612.
Diffstat (limited to 'ext/curl')
-rw-r--r--ext/curl/interface.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 39f7b7e5d0..82f512d29d 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -1141,6 +1141,10 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_TLS13_CIPHERS);
#endif
+#if LIBCURL_VERSION_NUM >= 0x073E00 /* Available since 7.62.0 */
+ REGISTER_CURL_CONSTANT(CURLOPT_DOH_URL);
+#endif
+
#if LIBCURL_VERSION_NUM >= 0x074000 /* Available since 7.64.0 */
REGISTER_CURL_CONSTANT(CURLOPT_HTTP09_ALLOWED);
#endif
@@ -2450,6 +2454,9 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue, bool i
#if LIBCURL_VERSION_NUM >= 0x072800 /* Available since 7.40.0 */
case CURLOPT_UNIX_SOCKET_PATH:
#endif
+#if LIBCURL_VERSION_NUM >= 0x073E00 /* Available since 7.62.0 */
+ case CURLOPT_DOH_URL:
+#endif
case CURLOPT_KRBLEVEL:
{
if (Z_ISNULL_P(zvalue)) {