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

OpenSSL 1.1.1f中添加带十六进制BITSTRING的otherName至subjectAltName失败

问题描述

我尝试在subjectAltName中添加一个otherName,其BITSTRING为十六进制格式。根据ASN1_generate_nconf文档,格式应为FORMAT:HEX,BITSTRING:0123456...,但执行后失败,报错信息如下:

Error Loading command line extensions
139796908598592:error:0D0B20C2:asn1 encoding routines:ASN1_generate_v3:unknown tag:../crypto/asn1/asn1_gen.c:94:
139796908598592:error:220A4093:X509 V3 routines:a2i_GENERAL_NAME:othername error:../crypto/x509v3/v3_alt.c:492:
139796908598592:error:22098080:X509 V3 routines:X509V3_EXT_nconf:error in extension:../crypto/x509v3/v3_conf.c:47:name=subjectAltName, value=otherName:2.5.4.45;FORMAT:HEX,BITSTRING:1234567890

我使用的是OpenSSL 1.1.1f,推测逗号是问题根源,已尝试以下两种方式:

直接命令行执行

openssl req -newkey -x509 -subj "/CN=Test" -nodes -out test.pem -addext "subjectAltName=otherName:2.5.4.45;FORMAT:HEX,BITSTRING:1234567890"

通过配置文件执行

openssl req -newkey -x509 -subj "/CN=Test" -nodes -out test.pem -extensions SAN -config <(printf "[SAN]
subjectAltName=otherName:2.5.4.45;FORMAT:HEX,BITSTRING:1234567890")

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.08 06:55:15