Skip to content

Commit 3dad63b

Browse files
Ayeshnikic
authored andcommitted
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.
1 parent 2d0dd4d commit 3dad63b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ PHP 8.1 UPGRADE NOTES
7979
prefix similar to hexadecimal ("0x"/"0X) and binary ("0b"/"0B") integer literals
8080
RFC: https://wiki.php.net/rfc/explicit_octal_notation
8181

82+
- Curl:
83+
. Added CURLOPT_DOH_URL option.
84+
8285
- hash:
8386
. The following functions have changed signatures:
8487

ext/curl/interface.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,10 @@ PHP_MINIT_FUNCTION(curl)
11411141
REGISTER_CURL_CONSTANT(CURLOPT_TLS13_CIPHERS);
11421142
#endif
11431143

1144+
#if LIBCURL_VERSION_NUM >= 0x073E00 /* Available since 7.62.0 */
1145+
REGISTER_CURL_CONSTANT(CURLOPT_DOH_URL);
1146+
#endif
1147+
11441148
#if LIBCURL_VERSION_NUM >= 0x074000 /* Available since 7.64.0 */
11451149
REGISTER_CURL_CONSTANT(CURLOPT_HTTP09_ALLOWED);
11461150
#endif
@@ -2449,6 +2453,9 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue, bool i
24492453
#endif
24502454
#if LIBCURL_VERSION_NUM >= 0x072800 /* Available since 7.40.0 */
24512455
case CURLOPT_UNIX_SOCKET_PATH:
2456+
#endif
2457+
#if LIBCURL_VERSION_NUM >= 0x073E00 /* Available since 7.62.0 */
2458+
case CURLOPT_DOH_URL:
24522459
#endif
24532460
case CURLOPT_KRBLEVEL:
24542461
{

0 commit comments

Comments
 (0)