mirror of
https://github.com/curl/curl.git
synced 2026-07-30 22:58:03 +03:00
sectransp: add support for HTTP/2 in gcc builds
Before this patch `--http2` did not work in gcc builds with Secure Transport, because ALPN relied on a compiler supporting the `HAVE_BUILTIN_AVAILABLE` aka `__builtin_available()` feature. This is clang-specific and missing from gcc (as of gcc v14). Add support for ALPN and HTTP/2 when this compiler feature is missing. Also drop test exceptions from GHA/macos in CI. Follow-up to092f6815c8Ref:c349bd668c#14097 (issue 15.) Ref: #4314 Closes #16581
This commit is contained in:
parent
9463769f2e
commit
2d94439eaa
2 changed files with 8 additions and 10 deletions
|
|
@ -1091,10 +1091,13 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
|
|||
if(result != CURLE_OK)
|
||||
return result;
|
||||
|
||||
if(connssl->alpn) {
|
||||
#if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && \
|
||||
defined(HAVE_BUILTIN_AVAILABLE)
|
||||
if(connssl->alpn) {
|
||||
if(__builtin_available(macOS 10.13.4, iOS 11, tvOS 11, *)) {
|
||||
#else
|
||||
if(&SSLSetALPNProtocols && &SSLCopyALPNProtocols) {
|
||||
#endif
|
||||
struct alpn_proto_buf proto;
|
||||
size_t i;
|
||||
CFStringRef cstr;
|
||||
|
|
@ -1117,7 +1120,6 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
|
|||
infof(data, VTLS_INFOF_ALPN_OFFER_1STR, proto.data);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(ssl_config->key) {
|
||||
infof(data, "WARNING: SSL: CURLOPT_SSLKEY is ignored by Secure "
|
||||
|
|
@ -2088,10 +2090,13 @@ check_handshake:
|
|||
break;
|
||||
}
|
||||
|
||||
if(connssl->alpn) {
|
||||
#if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && \
|
||||
defined(HAVE_BUILTIN_AVAILABLE)
|
||||
if(connssl->alpn) {
|
||||
if(__builtin_available(macOS 10.13.4, iOS 11, tvOS 11, *)) {
|
||||
#else
|
||||
if(&SSLSetALPNProtocols && &SSLCopyALPNProtocols) {
|
||||
#endif
|
||||
CFArrayRef alpnArr = NULL;
|
||||
CFStringRef chosenProtocol = NULL;
|
||||
err = SSLCopyALPNProtocols(backend->ssl_ctx, &alpnArr);
|
||||
|
|
@ -2119,7 +2124,6 @@ check_handshake:
|
|||
CFRelease(alpnArr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue