跳到主要内容
ecdsa.com
OpenSSL (client or server side)OpenSSL CLI

错误信息

SSL routines:tls_setup_handshake:no protocols available

也可能输出为

  • error:0A0000BF:SSL routines::no protocols available

openssl CLI(3.0 和 3.5)输出“error:0A0000BF:SSL routines:tls_setup_handshake:no protocols available”;格式化错误时不带函数名的应用程序显示为“error:0A0000BF:SSL routines::no protocols available”。

OpenSSL (client or server side) — SSL_R_NO_PROTOCOLS_AVAILABLE before the handshake starts

含义

OpenSSL 连握手都拒绝开始,因为应用所有限制之后,已经没有可以提供的协议版本了。通常是应用程序要求使用 TLS 1.0 或 1.1,而 OpenSSL 的安全级别(当前发行版默认为 2)禁止使用它们;或者配置的最低版本高于最高版本。没有任何数据发送到服务器。

原因

修复方法

  1. 1.

    找出施加限制的设置

    在 openssl.cnf 和系统加密策略中查找 MinProtocol、MaxProtocol 以及 CipherString 中的 @SECLEVEL 值。

    bash
    openssl version -d                                  # where openssl.cnf lives
    grep -nE 'MinProtocol|MaxProtocol|CipherString' /usr/lib/ssl/openssl.cnf /etc/ssl/openssl.cnf 2>/dev/null
    update-crypto-policies --show 2>/dev/null           # RHEL/Fedora system policy
  2. 2.

    旧设备:仅对单条命令降低安全级别

    在密码套件字符串中加上 @SECLEVEL=0,只会为那一次调用重新启用 TLS 1.0/1.1。不要把这类例外写进系统级配置,也不要在不受信任的网络上使用。

    bash
    # For a one-off test against a legacy device: lower the security level for this command only
    echo | openssl s_client -connect legacy.example.com:443 -tls1 -cipher 'DEFAULT:@SECLEVEL=0'
  3. 3.

    使用自洽的版本范围

    确保最低版本不高于最高版本;如今常用的范围是 TLS 1.2 到 TLS 1.3。

    ini
    # openssl.cnf (system_default_sect): a consistent range
    MinProtocol = TLSv1.2
    MaxProtocol = TLSv1.3

相关错误

浏览完整的签名错误库