You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

OpenSSL 1.1.1c通过openssl.conf加载自定义引擎执行openssl engine命令报错

自定义OpenSSL引擎配置加载问题定位与修正

问题根源

报错核心触发点是OpenSSL在解析rsa_section引擎配置段时,把段内的oid_section = new_oids键值对当成了需要下发给自定义引擎的ctrl指令,但你的引擎未实现该指令的处理逻辑,因此抛出invalid cmd name错误。
出现该问题的原因是配置项位置写错:oid_section是OpenSSL顶层配置的预定义键,用于指定自定义OID的定义段,不属于引擎配置段的合法项,被错误放置到了rsa_section中。

修正步骤

  • 检查/opt/openssl下的OpenSSL配置文件(默认文件名为openssl.cnf,若你存为openssl.conf需确认OpenSSL是否可识别),完整查看rsa_section段的全部内容,删除其中的oid_section = new_oids行。
  • 若需要使用自定义OID,将oid_section = new_oids配置移动到[openssl_def]顶层段下,同时确保OID定义段[new_oids]的语法正确。
  • 若无需自定义OID,直接删除所有与oid_section、new_oids相关的配置行。

正确配置示例(含自定义OID场景)

# 全局配置入口
openssl_conf = openssl_def

[openssl_def]
# 引擎配置段映射
engines = engine_section
# 自定义OID段映射(无需则删除该行)
oid_section = new_oids

# 自定义OID定义段(无需则删除整个段)
[new_oids]
# 格式:短名 = 长名 = OID数值,示例:
# my_engine_oid = my custom engine identifier = 1.3.6.1.4.1.xxxx.1

[engine_section]
# 自定义引擎名与配置段映射
rsa-engine-new = rsa_section

[rsa_section]
# 仅保留引擎ID配置,其他键需对应引擎实现的ctrl指令
engine_id = rsa-engine-new
# 可选:指定引擎默认支持的算法,无需则删除
default_algorithms = RSA

验证方法

  • 执行openssl version -d确认OpenSSL的默认配置目录,确保配置文件放置在正确路径下。
  • 执行openssl engine rsa-engine-new测试单引擎加载,确认无报错。
  • 执行openssl engine -v查看全部引擎加载状态,确认自定义引擎无错误输出。

内容的提问来源于stack exchange,提问作者user45698746

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.26 06:36:03