【问题标题】:curl and wget not working with https sites after upgrade to ubuntu 18.04.1升级到 ubuntu 18.04.1 后 curl 和 wget 无法使用 https 站点
【发布时间】:2019-02-08 12:17:35
【问题描述】:

似乎是与 openssl 相关的问题。有人知道这是什么吗?

请注意,该网址可在浏览器中使用。

使用 wget:

# wget -d https://deb.nodesource.com/setup_8.x

DEBUG output created by Wget 1.19.4 on linux-gnu.

Reading HSTS entries from /home/user/.wget-hsts
URI encoding = ‘UTF-8’
Converted file name 'setup_8.x' (UTF-8) -> 'setup_8.x' (UTF-8)
--2018-09-02 19:54:06--  https://deb.nodesource.com/setup_8.x
Could not seed PRNG; consider using --random-file.
OpenSSL: error:2406F07A:random number generator:RAND_load_file:Not a regular file
Disabling SSL due to encountered errors.

使用卷曲:

# curl -v -L https://deb.nodesource.com/setup_8.x

*   Trying 205.251.207.2...
* TCP_NODELAY set
* Connected to deb.nodesource.com (205.251.207.2) port 443 (#0)

<hangs>

【问题讨论】:

  • 这在这个 vagrant box benno/ubntu-18.04 中运行良好,它也是 18.04.1。这些命令在您的环境中使用的 OpenSSL 库的确切版本是什么?
  • libssl.so.1.1 => /usr/local/lib/libssl.so.1.1
  • 执行strings /usr/local/lib/libssl.so.1.1 | grep ^OpenSSL时显示的版本是什么?
  • OpenSSL 1.1.1-dev xx XXX xxxx
  • 暂时忘记我的回答,您可以查看此链接Could not seed PRNG; consider using --random-file. 并尝试推荐吗?

标签: curl https openssl wget ubuntu-18.04


【解决方案1】:

您似乎遇到了这个 OpenSSL 错误/功能:1.1.1 -> RAND_load_file() does not accept special files

查看源代码op wget,可以看到它调用了函数init_prng()中的RAND_load_file()。该函数还解释了一些可以用来指向不同文件(应该是常规文件)的选项:

  /* Seed from a file specified by the user.  This will be the file
     specified with --random-file, $RANDFILE, if set, or ~/.rnd, if it
     exists.  */

您可以尝试其中任何一种,或者使用1.1.0-版本的 OpenSSL。或者使用gnutls,就像你已经做的那样:-)


顺便说一句,我无法重现您的问题,所以我不能确定这是原因所在。但是,我不认为你的问题是升级到 18.04.1 引起的。您当前的 OpenSSL 安装似乎有点被其他东西弄乱了。版本号表明这是从未标记的 OpenSSL 存储库状态构建的。我不希望这些库在位于 /usr/lib/x86_64-linux-gnu 中的“标准”OpenSSL 库之前出现在您的 LD_LIBRARY_PATH 中。


根据来回的cmets,最后的结论是你过去已经构建并安装了一个版本的OpenSSL 1.1.1,并且当时它运行良好。但是更新到18.04.1之后,提到的bug就暴露了。弄清楚该更新中的哪些确切更改导致它会很有趣,但我想现在知道您问题的直接答案就足够了:-)

【讨论】:

  • 是的,我也在 openssl github 上看到了这个问题。那里的建议似乎没有帮助。无论如何,我真的很想了解为什么这对我们来说是坏的(还有其他人有同样的问题)。另外,我不确定“从未标记的仓库构建”是什么意思。 openssl 软件包是 Ubuntu 附带的(我很确定)。是什么让你不这么认为?
  • 我不认为这个特殊的 openssl 包是随 Ubuntu 一起提供的。版本号OpenSSL 1.1.1-dev xx XXX xxxx 不是您在普通发行版中看到的,而且您获取 OpenSSL 库的位置似乎也不是标准位置。您是否也在 /usr/lib/x86_64-linux-gnu 中看到了 OpenSSL 库?
  • 我所拥有的只有:/usr/lib/x86_64-linux-gnu/openssl-1.0.0/engines。
  • 我对 Ubuntu 打包了解不多,但我的干净 18.04.1 安装看起来不同。也许您应该手动安装 openssl 包。这个已确认但未分配的错误报告可能表明您的 OpenSSL 1.1.1 版本不是官方发行版的一部分:Please provide ED25519 support in 18.04 OpenSSL
  • 好的,我添加了一个结论——随意编辑你的喜好。这可能是您最后一次安装非官方版本的 OpenSSL,不是吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-08-23
  • 2020-10-22
  • 2020-02-20
  • 1970-01-01
相关资源
最近更新 更多