Error: An unknown option was passed in to libcurl when using CURLOPT_SSL_ENABLE_ALPN #4668
Comments
- Stop treating lack of HTTP2 as an unknown option error result for CURLOPT_SSL_ENABLE_ALPN and CURLOPT_SSL_ENABLE_NPN. Prior to this change it was impossible to disable ALPN / NPN if libcurl was built without HTTP2. Setting either option would result in CURLE_UNKNOWN_OPTION and the respective internal option would not be set. That was incorrect since ALPN and NPN are used independent of HTTP2. Reported-by: Shailesh Kapse Fixes curl#4668 Closes #xxxx
Those options erroneously require HTTP/2 support: Lines 2615 to 2622 in 2e9b725 If that is your issue then please try the fix in #4672. If that doesn't work then give us this output: curl_version_info_data *info = curl_version_info(CURLVERSION_NOW);
printf("SSPI is %s\n", ((info->features & CURL_VERSION_SSPI) ? "on" : "off"));
printf("HTTP2 is %s\n", ((info->features & CURL_VERSION_HTTP2) ? "on" : "off"));
printf("%s\n", curl_version()); |
@jay Replicated the changes committed by you. This solves the issue. |
See the pending release-notes page: January 8th 2020 is the scheduled release date for the coming 7.68.0 release. You can however always download the current state from git or as a daily snapshot to try out the coming changes even before they ship! |
Thanks |
What I did,
As per this man page for
CURLOPT_SSL_ENABLE_ALPN
, the option is enabled by default, and we can see the ALPN extension set in Client Hello using Wireshark. However, I want to disable that option, so that ALPN extension is not present in Client Hello (TLS Handshake). I tried below code,CURLcode res = CURLE_OK;
res = curl_easy_setopt(curl_, CURLOPT_SSL_ENABLE_ALPN, 0L);
if(res == CURLE_OK){
cout<<"CURLOPT_SSL_ENABLE_ALPN to 0L res = "<<res;
}else{
cout<<"Error: res = "<<res<<"\t"<<curl_easy_strerror(res);
}
Output:
Error: res = 48 An unknown option was passed in to libcurl
I expected the following
CURLOPT_SSL_ENABLE_ALPN to 0L res = 0
curl/libcurl version
libcurl Version: 7.67.0
openssl version: OpenSSL 1.1.0l
libcurl configuration options
./configure --prefix= " << full path to installation directory >> " --disable-manual --enable-ipv6 --disable-ntlm-wb --without-krb4 --without-gssapi --with-ssl=" << full path to openssl folder containing library and include files >> " --without-gnutls --without-polarssl --without-cyassl --without-nss --without-axtls --without-libmetalink --without-libssh2 --disable-ldap --without-libidn LDFLAGS="-Wl,-rpath -Wl, << full path to openssl library folder >> "
operating system
Linux, MACOSX
Even though this option throws error in MacOSX also, ALPN extension is not present in TLS Handshake on MacOSX
Is this option deprecated? Or am I missing something here?
The text was updated successfully, but these errors were encountered: