You need to enable JavaScript to run this app. 已添加根CA证书但osslsigncode验证仍失败的问题排查
优惠活动
大模型
产品
解决方案
定价
更多

已添加根CA证书但osslsigncode验证仍失败的问题排查

自签名证书签名Windows可执行文件验证失败排查

前提信息

  • 不想发布程序,选择使用自签名证书
  • 操作环境为基于Arch的Linux系统
  • 需要分享程序给不会手动关闭Windows安全提示的用户,用户可安装我的证书
  • 暂不在Windows上操作,认为Linux验证失败的话Windows也会失败

操作步骤

对证书相关知识不了解,按照Stack Overflow回答创建所需证书(仅执行步骤1至6),随后按另一篇Stack Overflow回答的第一种方法对可执行文件签名。

使用以下命令验证签名:

$ osslsigncode verify -in <myprogram>-signed.exe

验证失败,报错如下:

PKCS7_verify error
40377E953E700000:error:10800075:PKCS7 routines:PKCS7_verify:certificate verify error:crypto/pkcs7/pk7_smime.c:296:Verify error: unable to get local issuer certificate
Signature verification: failed

已尝试的排查方法

  1. 修改代码签名证书配置的basicConstraints为CA:TRUE(原配置为CA:FALSE),问题依旧。配置内容:
# code_sign_cert.conf
authorityKeyIdentifier = keyid,issuer
basicConstraints       = CA:TRUE
subjectAltName         = @alt_names
extendedKeyUsage       = codeSigning

[alt_names]
DNS.1 = the-company.com # 不清楚此处该填什么
  1. 将rootCA.crt添加到信任库:
# trust anchor --store rootCA.crt

执行sudo update-ca-trust确保生效,已在/etc/ca-certificates/目录找到该证书(名称为个人名字而非rootCA),但验证仍失败。

对各类证书格式感到困惑,不知道该从何处入手排查问题,请问验证失败的原因是什么?


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.01 07:53:16