加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – libcurl不支持HTTPS

发布时间:2020-12-14 00:43:13 所属栏目:Linux 来源:网络整理
导读:我在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.txtcurl: (1) Protocol "https" not sup
我在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
我尝试过不同的命令:

root@carlo-ThinkPad-W541:~/curl-7.48.0# ./configure --with-ssl

试图指定我的openSSL库的位置:

root@carlo-ThinkPad-W541:~/curl-7.48.0# ./configure --with-ssl=/lib/x86_64-linux-gnu/

设置env变量:

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: 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,darwinssl} )
  SSH support:      no      (--with-libssh2)
  zlib support:     enabled
  GSS-API support:  no      (--with-gssapi)
  TLS-SRP support:  no      (--enable-tls-srp)
  resolver:         default (--enable-ares / --enable-threaded-resolver)
  IPv6 support:     enabled
  Unix sockets support: enabled
  IDN support:      no      (--with-{libidn,winidn})
  Build libcurl:    Shared=yes,Static=yes
  Built-in manual:  enabled
  --libcurl option: enabled (--disable-libcurl-option)
  Verbose errors:   enabled (--disable-verbose)
  SSPI support:     no      (--enable-sspi)
  ca cert bundle:   /etc/ssl/certs/ca-certificates.crt
  ca cert path:     no
  ca fallback:      no
  LDAP support:     no      (--enable-ldap / --with-ldap-lib / --with-lber-lib)
  LDAPS support:    no      (--enable-ldaps)
  RTSP support:     enabled
  RTMP support:     no      (--with-librtmp)
  metalink support: no      (--with-libmetalink)
  PSL support:      no      (libpsl not found)
  HTTP2 support:    disabled (--with-nghttp2)
  Protocols:        DICT FILE FTP GOPHER HTTP IMAP POP3 RTSP SMTP TELNET TFTP

root@carlo-ThinkPad-W541:~/curl-7.48.0# 

解决方法

卷曲配置的–with-ssl选项将使其检查(并且理想地使用)OpenSSL.

您需要首先确保拥有OpenSSL开发包,以便构建过程可以使用标头并找到相关的库等.

如果您的系统上某处有自定义版本的OpenSSL,则可以使用./configure –with-ssl = / path / to / prefix指出该自定义OpenSSL安装树的根目录.

如果仍然无法正确查找和使用OpenSSL,则应考虑打开配置在运行时创建的文件config.log.然后在那里搜索openssl并尝试分析openssl的检查以及它们失败的原因.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读