libcurl不支持HTTPS。

5
我正在运行Ubuntu 14.04,并手动安装了curl 7.48(参见问题Libcurl not updated)。
我尝试执行以下命令:
carlo@carlo-ThinkPad-W541:/usr/bin$ curl -sS https://storage.googleapis.com/kubernetes-release/release/stable.txt
curl: (1) Protocol "https" not supported or disabled in libcurl
carlo@carlo-ThinkPad-W541:/usr/bin$
因此,我快速检查了配置输出,它明确表示不支持SSL:
configure: Configured to build curl/libcurl:
curl version: 7.48.0 Host setup: x86_64-unknown-linux-gnu Install prefix: /usr/local Compiler: gcc SSL support: no (--with-{ssl,gnutls,nss,polarssl,mbedtls,cyassl,axtls,winssl,darwinssl} )
所以我看了这个链接https://curl.haxx.se/docs/install.html 并尝试了不同的命令:
尝试指定我的openSSL库的位置:
root@carlo-ThinkPad-W541:~/curl-7.48.0# ./configure --with-ssl=/lib/x86_64-linux-gnu/
设置环境变量:
root@carlo-ThinkPad-W541:~/curl-7.48.0# export LDFLAGS="-L/lib/x86_64-linux-gnu/"
root@carlo-ThinkPad-W541:~/curl-7.48.0# ./configure --with-ssl
但是似乎都不起作用,结果总是相同的:
[...]
configure: 配置构建curl/libcurl:
curl版本: 7.48.0 主机设置: x86_64-unknown-linux-gnu 安装前缀: /usr/local 编译器: gcc SSL支持: 否 (--with-{ssl,gnutls,nss,polarssl,mbedtls,cyassl,axtls,winssl,darwinssl} ) SSH支持: 否 (--with-libssh2) zlib支持: 已启用 GSS-API支持: 否 (--with-gssapi) TLS-SRP支持: 否 (--enable-tls-srp) 解析器: 默认 (--enable-ares / --enable-threaded-resolver) IPv6支持: 已启用 Unix套接字支持: 已启用 IDN支持: 否 (--with-{libidn,winidn}) 构建libcurl: 共享=yes,静态=yes 内置手册: 已启用 --libcurl选项: 已启用 (--disable-libcurl-option) 详细错误: 已启用 (--disable-verbose) SSPI支持: 否 (--enable-sspi) ca证书捆绑包: /etc/ssl/certs/ca-certificates.crt ca证书路径: 否 ca回退: 否 LDAP支持: 否 (--enable-ldap / --with-ldap-lib / --with-lber-lib) LDAPS支持: 否 (--enable-ldaps) RTSP支持: 已启用 RTMP支持: 否 (--with-librtmp) metalink支持: 否 (--with-libmetalink) PSL支持: 否 (libpsl未找到) HTTP2支持: 禁用 (--with-nghttp2) 协议: DICT FILE FTP GOPHER HTTP IMAP POP3 RTSP SMTP TELNET TFTP
root@carlo-ThinkPad-W541:~/curl-7.48.0#

也许这个链接可以帮助。 - arne.z
1个回答

7

--with-ssl 选项会让 curl 的配置去检查(并且最好使用)OpenSSL。

在构建过程中,您需要确保先安装了 OpenSSL 开发包以便使用头文件并找到相关库等。

如果您在系统的某个地方有自定义版本的 OpenSSL,则可以使用 ./configure --with-ssl=/path/to/prefix 告知该自定义 OpenSSL 安装树的根目录位置。

如果仍然无法正确找到并使用 OpenSSL,则应考虑打开运行时 configure 创建的 config.log 文件。然后在其中搜索 openssl,尝试分析 openssl 检查失败的原因。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接