OpenSSL 无法建立 SSL 连接,因为不支持的协议

OpenSSL can't establish SSL connection because unsupported protocol

我正在尝试从 here 构建 OpenCog,当我发出此命令时

octool -rdcpav -l default

它构建所有内容,但随后进入安装 Link-Grammar 的步骤,这发生了

[octool] Installing Link-Grammar....
--2020-06-13 10:09:36--  http://www.abisource.com/downloads/link-grammar/current/
Resolving www.abisource.com (www.abisource.com)... 130.89.149.216
Connecting to www.abisource.com (www.abisource.com)|130.89.149.216|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://www.abisource.com/downloads/link-grammar/current/ [following]
--2020-06-13 10:09:37--  https://www.abisource.com/downloads/link-grammar/current/
Connecting to www.abisource.com (www.abisource.com)|130.89.149.216|:443... connected.
OpenSSL: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
Unable to establish SSL connection.

我在 ubuntu 20.04 LTS

www.abisource.com 仅支持 TLS 1.0 版,该版本现已损坏(或至少被削弱)并且已经过时。根据它的 headers 它是 Apache 2.2.15 (Fedora) 可以追溯到 2010 年!

因此这似乎是与 OpenSSL v1.1.1 ssl_choose_client_version unsupported protocol 相同的问题,除了 Ubuntu 而不是 Debian 和 wget(由 octool 使用)而不是 openvpn。在那里尝试接受的答案:在 [system_default_sect] 下编辑 /etc/ssl/openssl.cnf 以降级 MinProtocol=TLSv1 和可能的 CipherString=DEFAULT:@SECLEVEL=1——服务器的 DHE 密钥是 1k,我不记得了如果它在 2 级工作,尽管它的证书是荒谬的 RSA 4k!

更新: 好的,我下载并安装了 Ubuntu 20.04,包括 libssl1.1 的源代码并查看了它,他们没有在这里保留 Debian 方法,他们改变了它。具体来说,他们没有更改 openssl.cnf 文件以要求 TLSv1.2,而是 编译 OpenSSL/libssl 使 默认 SECLEVEL 2 and 让 SECLEVEL 2 强制 TLSv1.2(它不是上游)。

但是,您仍然可以通过 添加 所需的(弱)配置来修复它 openssl.cnf:

  • 在默认部分的某处,即在以 [ 开头的第一行之前,添加一行

    openssl_conf = openssl_configuration
    

    我喜欢把它放在最上面,但这就是我。

  • 技术上在任何部分边界,但 much-easiest 在末尾添加三个新部分:

    [openssl_configuration]
    ssl_conf = ssl_configuration
    [ssl_configuration]
    system_default = tls_system_default
    [tls_system_default]
    CipherString = DEFAULT:@SECLEVEL=1
    

请注意,由于 MinProtocol 尚不存在,因此您无需添加它(代码默认设置没问题),但如果您愿意,也可以添加。

现在可以使用了:

$ wget https://www.abisource.com/
--2020-06-20 05:11:11--  https://www.abisource.com/
Resolving www.abisource.com (www.abisource.com)... 130.89.149.216
Connecting to www.abisource.com (www.abisource.com)|130.89.149.216|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7687 (7.5K) [text/html]
Saving to: ‘index.html’

index.html          100%[===================>]   7.51K  --.-KB/s    in 0.002s

2020-06-20 05:11:12 (3.90 MB/s) - ‘index.html’ saved [7687/7687]

正如您所说,这是一个全球性的变化。您可以通过编辑您的 octool 副本以将选项 --ciphers=DEFAULT:@SECLEVEL=1 添加到 wget 命令来针对此特定操作更改它。与原openssl.cnf:

$ wget --ciphers=DEFAULT:@SECLEVEL=1 https://www.abisource.com/
--2020-06-20 05:15:21--  https://www.abisource.com/
Resolving www.abisource.com (www.abisource.com)... 130.89.149.216
Connecting to www.abisource.com (www.abisource.com)|130.89.149.216|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7687 (7.5K) [text/html]
Saving to: ‘index.html.1’

index.html.1        100%[===================>]   7.51K  --.-KB/s    in 0s

2020-06-20 05:15:22 (330 MB/s) - ‘index.html.1’ saved [7687/7687]

跟踪这个问题的问题here