Reputation: 11
As per this, in libcurl, the CURLOPT_SSL_ENABLE_ALPN
option is enabled by default. For a project, I am trying to disable the ALPN extension, as below:
CURLcode res = CURLE_OK;
res = curl_easy_setopt(curl_, CURLOPT_SSL_ENABLE_ALPN, 0L);
if(res == CURLE_OK){
cout<<"Set CURLOPT_SSL_ENABLE_ALPN to 0L res = "<<res;
}else{
cout<<"Set CURLOPT_SSL_ENABLE_ALPN to 1L res = "<<res<<"\t"<<curl_easy_strerror(res);
}
This is throwing me an error:
Set CURLOPT_SSL_ENABLE_ALPN to 1L res = 48 An unknown option was passed in to libcurl
And, I can see ALPN extension present in TLS handshake, able to see it with Wireshark. How do I disable the ALPN extension? Openssl Version: OpenSSL 1.1.0k Curl Version: 7.67.0
Upvotes: 1
Views: 1894
Reputation: 11
Apparently, if you don't compile with libcurl with HTTP2 support (libnghttp2), it is treating CURLOPT_SSL_ENABLE_ALPN
and CURLOPT_SSL_ENABLE_NPN
as unknown options, though ALPN and NPN are independent of HTTP2. It was a bug in libcurl.
I had reported this behavior at libcurl github repo here, which they fixed it and fix will be available in next release.
Upvotes: 0
Reputation: 85256
In libcurl, all possible options are #define
'd in the header, but it doesn't mean all are supported.
It looks like your libcurl
was not built with HTTP2 support (libnghttp2).
For ALPN or NPN to actually work, curl_version_info()
should include CURL_VERSION_HTTP2
.
Upvotes: 1