升级包和烧片包中, 预置的白牌包没有生效

问题描述

升级包和烧片包中, 预置的白牌包没有生效(体现在ssl证书在烧片和升级后没有导入)

环境信息

  • 操作系统:[如 Ubuntu 24.04]

  • 软件版本:1230SP1版本

  • 硬件配置: openUBMC 1711 (2280版本)

重现步骤

  1. manifest配置如下, 预期会包ssl证书打入hpm包
wbd_up_files: # 会自动打包集成到hpm里面的白牌包
  files:
    - file: ${board_path}/wbd_up_file/favicon.ico
      dst: wbd_up_file/favicon.ico
    - file: ${board_path}/wbd_up_file/filelist.conf
      dst: wbd_up_file/filelist.conf
    - file: ${board_path}/wbd_up_file/web_custom.xml
      dst: wbd_up_file/web_custom.xml
    - file: ${board_path}/wbd_up_file/customize.pfx
      dst: wbd_up_file/customize.pfx
manufacture:
  0502YGWD: # 烧片包
    wbd_up_files: # 会自动打包集成到hpm里面的白牌包
      files:
        - file: ${board_path}/wbd_up_file/favicon.ico
          dst: wbd_up_file/favicon.ico
        - file: ${board_path}/wbd_up_file/filelist.conf
          dst: wbd_up_file/filelist.conf
        - file: ${board_path}/wbd_up_file/web_custom.xml
          dst: wbd_up_file/web_custom.xml
        - file: ${board_path}/wbd_up_file/customize.pfx
          dst: wbd_up_file/customize.pfx

  1. 编译后, 烧片, 预置的ssl证书没有生效, 体现在web无响应
  2. 查看环境, 发现环境上白牌包tar包已经打入
    70.183.12.117 iBMC-1711 /opt/bmc/apps/hica # ls /opt/bmc/white_branding/
    wbd_up_file.tar.gz
    
  3. 使用通用的ssl证书做成的单独的白牌包, 升级后可以生效,导入ssl证书成功
  0502YLAK: # 通用的SSL的白牌包
    wbd_hpms:
      # repo为存放白牌包定制文件的仓库地址,需要填写https下载的地址
      - repo: https://.git
        # tag为存放定制文件的分支tag号
        tag: master
        files:
          # path为白牌定制文件存放路径,但是dst路径不可修改,均为"wbd_up_file/文件名"的格式,如下示例
          - file: CI_Build/common_wbd/wbd_up_file/web_custom.xml
            dst: wbd_up_file/web_custom.xml
          - file: CI_Build/common_wbd/wbd_up_file/filelist.conf
            dst: wbd_up_file/filelist.conf
          - file: CI_Build/common_wbd/wbd_up_file/customize.pfx
            dst: wbd_up_file/customize.pfx
          # 下列文件都是制作白牌包必须文件,路径固定,不可删除
          - file: /usr/share/bmcgo/wbd-packet/beforeaction.sh
          - file: /usr/share/bmcgo/wbd-packet/afteraction.sh
            dst: afteraction.sh
          - file: /usr/share/bmcgo/wbd-packet/CfgFileList.conf
          - file: /usr/share/bmcgo/wbd-packet/firstboot.sh
          - file: /usr/share/bmcgo/wbd-packet/hpm_wbd.config
          - file: /usr/share/bmcgo/wbd-packet/packetwbd.sh
          - file: /usr/share/bmcgo/wbd-packet/update.cfg
    # dst为最后制作出来的白牌包名称

期望结果

在配置wbd_up_files后, 预期烧片包和hpm包都能直接升级生效白牌包配置文件

实际结果

见问题描述

尝试过的解决方案

分析结论

升级过程中有没有什么错误日志呢

这个是烧片后的一键收集日志
dump_null_20260401-0647.tar.gz (2.3 MB)

这条操作日志对应的是我手动升级 SSL白牌包的时间点, 在此之前, 没有尝试导入ssl的记录
2026-04-01 02:54:06 CLI,Administrator@192.168.109.123:9326,firmware_mgmt,Upgrade image.hpm started
2026-04-01 02:54:10 CLI,Administrator@192.168.109.123:9326,trust,Import custom certificate successfully

预制证书是否带有 PreSSLSeverCountry 字段?

从AI解包的情况来看, pfx中没有带这个字段;
我的XML文件里面带了

<?xml version="1.0" encoding="UTF-8"?>
<CUSTOM_CONFIG>
    <!-- SSL证书预置信息,当前安装的SSL证书的签发者信息和预置信息一致时,认为当前SSL证书是预置证书,web会提醒用户安装新证书 -->
    <PreSSLSeverCommonName VALUE="Henan Kunlun Technologies IT Product"/>
    <PreSSLSeverOrgName VALUE="Henan Kunlun Technologies"/>
    <PreSSLSeverCountry VALUE=""/>
</CUSTOM_CONFIG>
pfx文件解出后的字段
 Shell openssl pkcs12 -in /tmp/customize_pre.pfx -passin "pass:" -nodes 2>/dev/null | openssl x509 -text -noout 2>&1 (查看证书完整内容)                                                               │
  │                                                                                                                                                                                                         │
  │    Certificate:                                                                                                                                                                                         │
  │        Data:                                                                                                                                                                                            │
  │            Version: 3 (0x2)                                                                                                                                                                             │
  │            Serial Number:                                                                                                                                                                               │
  │                20:24:07:19:18:01:11:4b:4c:e9:1f:ff:cd:bc:47:60:86:11                                                                                                                                    │
  │            Signature Algorithm: sha256WithRSAEncryption                                                                                                                                                 │
  │            Issuer: O = Henan Kunlun Technologies, CN = Henan Kunlun Technologies Equipment CA 1 - G1                                                                                                    │
  │            Validity                                                                                                                                                                                     │
  │                Not Before: Jul 19 10:01:11 2024 GMT                                                                                                                                                     │
  │                Not After : Jul 17 10:01:11 2034 GMT                                                                                                                                                     │
  │            Subject: O = Henan Kunlun Technologies, CN = Henan Kunlun Technologies IT Product                                                                                                            │
  │            Subject Public Key Info:                                                                                                                                                                     │
  │                Public Key Algorithm: rsaEncryption                                                                                                                                                      │
  │                    Public-Key: (2048 bit)                                                                                                                                                               │
  │                    Modulus:                                                                                                                                                                             │
  │                        00:bb:db:29:d4:f1:f2:b2:6d:09:c4:6b:f4:ae:ed:                                                                                                                                    │
  │                        de:04:c0:10:19:3c:0a:ae:98:89:08:a4:c0:55:74:                                                                                                                                    │
  │                        db:38:17:fb:4f:95:a6:fe:85:13:22:e8:d7:8a:b4:                                                                                                                                    │
  │                        ba:05:93:35:cc:f3:56:97:22:20:47:80:3c:6f:77:                                                                                                                                    │
  │                        9a:84:7e:e1:5f:a9:ae:76:e6:a5:66:1b:a5:f1:fb:                                                                                                                                    │
  │                        e7:81:0c:f1:bf:1b:5a:44:ea:be:83:57:e7:0e:34:                                                                                                                                    │
  │                        01:63:1d:b4:49:62:35:64:53:be:ea:1f:63:61:61:                                                                                                                                    │
  │                        90:8a:ef:1d:97:9e:4c:bf:9e:46:1c:5d:df:e2:38:                                                                                                                                    │
  │                        04:14:30:a4:6b:bd:b0:e3:f9:15:1f:31:e4:b8:9f:                                                                                                                                    │
  │                        20:9d:24:56:a3:8a:68:bf:33:98:0f:4e:56:60:27:                                                                                                                                    │
  │                        20:08:00:35:a9:5d:d0:e7:e7:2f:b5:24:63:1b:da:                                                                                                                                    │
  │                        68:cd:80:bc:46:60:e9:62:4e:a9:30:82:be:39:e9:                                                                                                                                    │
  │                        c8:c8:f4:3f:80:45:2d:bf:58:53:4d:1b:ae:4b:c4:                                                                                                                                    │
  │                        63:cc:92:11:e5:83:21:9e:9f:01:26:38:96:74:46:                                                                                                                                    │
  │                        59:67:fb:31:f8:5e:9f:24:ef:0c:bb:c5:b8:21:87:                                                                                                                                    │
  │                        58:f1:74:e8:23:a7:c6:1f:c0:f0:10:0b:ef:64:a5:                                                                                                                                    │
  │                        96:d0:b6:5f:56:49:e8:72:4c:1f:be:f0:be:d3:5b:                                                                                                                                    │
  │                        6e:67                                                                                                                                                                            │
  │                    Exponent: 65537 (0x10001)                                                                                                                                                            │
  │            X509v3 extensions:                                                                                                                                                                           │
  │                X509v3 Authority Key Identifier:                                                                                                                                                         │
  │                    10:08:B4:23:47:50:CC:24:1D:52:9D:35:E4:08:FE:2F:9A:E0:9D:5B                                                                                                                          │
  │                X509v3 Subject Key Identifier:                                                                                                                                                           │
  │                    55:92:E1:B9:1B:6E:80:36:33:AB:C8:83:71:99:0D:C9:60:FA:58:4B                                                                                                                          │
  │                X509v3 Subject Alternative Name:                                                                                                                                                         │
  │                    email:support@kunlunit.com                                                                                                                                                           │
  │                X509v3 Basic Constraints:                                                                                                                                                                │
  │                    CA:FALSE                                                                                                                                                                             │
  │                X509v3 Certificate Policies:                                                                                                                                                             │
  │                    Policy: 1.3.6.1.4.1.59988.201.1.4.1                                                                                                                                                  │
  │                      CPS: http://support.kunlunit.com/pki                                                                                                                                               │
  │                X509v3 Key Usage: critical                                                                                                                                                               │
  │                    Digital Signature, Key Encipherment, Key Agreement                                                                                                                                   │
  │                X509v3 CRL Distribution Points:                                                                                                                                                          │
  │                    Full Name:                                                                                                                                                                           │
  │                      URI:http://support.kunlunit.com/pki/equipment_ca1_g1crl.crl                                                                                                                        │
  │                X509v3 Extended Key Usage:                                                                                                                                                               │
  │                    TLS Web Server Authentication, TLS Web Client Authentication                                                                                                                         │
  │        Signature Algorithm: sha256WithRSAEncryption                                                                                                                                                     │
  │        Signature Value:                                                                                                                                                                                 │
  │            e0:ba:7b:ef:7e:51:d3:a0:08:4b:3e:ae:43:8c:51:84:55:fd:
AI分析证书结论

根据我的分析,这个 customize.pfx 证书文件中没有 PreSSLSeverCountry 字段。

检查结果总结


┌────────────────────────────────┬───────────────────────────────────────────────────────────────────────────────────┐
│ 检查项                         │ 结果                                                                              │
├────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────┤
│ 证书主题 (Subject)             │ O = Henan Kunlun Technologies, CN = Henan Kunlun Technologies IT Product          │
│ 颁发者 (Issuer)                │ O = Henan Kunlun Technologies, CN = Henan Kunlun Technologies Equipment CA 1 - G1 │
│ 有效期                         │ 2024-07-19 至 2034-07-17                                                          │
│ SAN (Subject Alternative Name) │ email:support@kunlunit.com                                                        │
│ 证书策略 OID                   │ 1.3.6.1.4.1.59988.201.1.4.1                                                       │
│ 用途                           │ 数字签名、密钥加密、密钥协商、TLS 服务器/客户端认证                               │
│ PreSSLSeverCountry 字段        │ ❌ 不存在                                                                         │
└────────────────────────────────┴───────────────────────────────────────────────────────────────────────────────────┘


证书包含的标准 X509v3 扩展字段:
 - Authority Key Identifier
 - Subject Key Identifier
 - Subject Alternative Name (仅 email)
 - Basic Constraints (CA:FALSE)
 - Certificate Policies
 - Key Usage
 - CRL Distribution Points
 - Extended Key Usage

结论:该 PFX 证书是标准的 SSL 客户端/服务器证书,不包含 PreSSLSeverCountry 这类自定义字段。如果 V3 白牌包需要这个字段才能正常导入,可能需要重新生成包含该字段的证书。

答案内容由AI生成,仅供参考:

:pushpin: 总结

问题 原因 解决方案
customize.pfx 未生效 wbd_up_files 仅复制文件,不触发导入逻辑 使用 bmcgo 构建完整白牌包
Web 无响应 未成功加载 SSL 证书,HTTPS 启动失败 手动导入证书或修复打包流程
打包成功但未生效 缺少 update.cfghpm_wbd.configafteraction.sh 等驱动脚本 完善白牌包构建配置
证书解析失败 加密 PFX 未去密 制作证书时先设密再清密导出

:light_bulb: 强烈建议:使用标准白牌包构建流程(bmcgo + wbd_hpms)替代直接的 wbd_up_files 文件注入方式,以确保所有定制内容(包括证书、样式、配置)能够正确部署和生效。

点击此处查看详细分析解答

白牌包中预置 SSL 证书未生效问题分析与解决方案

根据您提供的问题描述,wbd_up_files 中配置了 customize.pfx 证书文件,但通过烧片包或 HPM 升级后,SSL 证书并未成功导入,导致 Web 界面无响应。以下基于知识库内容进行综合分析,并提供解决建议。


:magnifying_glass_tilted_left: 问题核心结论

:white_check_mark: 问题本质:
尽管 wbd_up_file.tar.gz 已正确生成并打包到系统中(位于 /opt/bmc/white_branding/),但 SSL 证书未能自动导入 Web 服务,说明 白牌包虽已部署,但未触发证书导入逻辑

:no_entry: 根本原因推测:
仅将 customize.pfx 文件放入 wbd_up_files 并不能保证其自动生效。必须通过完整的白牌包构建流程(使用 bmcgo 工具 + update.cfg 等脚本)来驱动证书解析与导入逻辑。直接在 manifest.yml 中引入文件的方式,缺少必要的运行时执行机制。


:puzzle_piece: 根本原因分析

1. 白牌包生效依赖完整机制,而不仅仅是文件复制

从知识库可知:

  • :white_check_mark: wbd_up_files 配置会将文件打包进 HPM 包,并生成 wbd_up_file.tar.gz
  • :cross_mark:证书的导入需要由白牌升级服务解析 filelist.confweb_custom.xml,并通过执行 beforeaction.shafteraction.sh 等脚本完成实际导入动作
  • :white_check_mark: 单独的白牌包(通过 wbd_hpms 构建)是能生效的,因为它包含了完整的部署脚本(如 packetwbd.sh, update.cfg, hpm_wbd.config 等),这些脚本负责解压、校验和导入证书。

:link: 相关证据:[Document #4-Q5] 指出:“filelist.conf 中 customize.pfx 的路径未配置正确 → 证书不生效”。这表明证书生效依赖于 filelist.conf 正确解析。


2. 缺少白牌包专属构建机制 —— 使用 bmcgo 而非 bingo

  • :cross_mark: bingo build 仅支持将白牌资源集成到 HPM 包中,不支持独立构建完整白牌包
  • :white_check_mark: 真正的白牌包构建必须使用 bmcgo 工具,否则不会包含 update.cfg, hpm_wbd.config, packetwbd.sh 等关键控制脚本。
  • :white_check_mark: 参考文档明确指出:【Q1】“白牌包编译没有生成 wbd_output.zip” 的解决方法是:确定是否使用了 bmcgo,因为 bingo 不支持编译白牌包

:link: 信息来源:Search Result #4 - “常见问题 Q1”


3. customize.pfx 是否为加密证书?是否去密码?

  • :white_check_mark:customize.pfx 是加密的 .pfx 文件,在导入时需系统提供密码。
  • :white_check_mark: 白牌包导入过程中若密码不匹配,会报 “p12 parse fail” 错误(PFX 即 PKCS#12 格式)。
  • :white_check_mark: 正确流程应为:制作证书 → 设定密码 → 在打包前使用工具去除密码 → 放入包中。

:link: 信息来源:Search Result #1 - “升级白牌包时报 ‘p12 parse fail’”


4. filelist.conf 中路径配置是否正确?

必须确保 filelist.conf 中定义了 customize.pfx 的目标路径为:

[FileX]
Name=customize.pfx
Path=/data/opt/bmc/conf

否则系统不知道将其复制到何处,也无法被证书服务读取。

:link: 信息来源:Search Result #4-Q5 提示路径错误会导致证书不生效。


:white_check_mark: 推荐解决方案

:white_check_mark: 方案一:使用标准白牌包构建流程(推荐)

重构白牌包制作方式,使用 bmcgo 工具 + 完整白牌文件结构 进行构建。

步骤如下:

  1. 创建独立白牌包配置

    # manifest.yml 片段
    0502YLAK:
      wbd_hpms:
        - repo: https://your-git-repo.com/white-label.git
          tag: master
          files:
            - file: CI_Build/common_wbd/wbd_up_file/web_custom.xml
              dst: wbd_up_file/web_custom.xml
            - file: CI_Build/common_wbd/wbd_up_file/filelist.conf
              dst: wbd_up_file/filelist.conf
            - file: CI_Build/common_wbd/wbd_up_file/customize.pfx
              dst: wbd_up_file/customize.pfx
            # 必须包含这些脚本文件
            - file: /usr/share/bmcgo/wbd-packet/beforeaction.sh
            - file: /usr/share/bmcgo/wbd-packet/afteraction.sh
              dst: afteraction.sh
            - file: /usr/share/bmcgo/wbd-packet/CfgFileList.conf
            - file: /usr/share/bmcgo/wbd-packet/firstboot.sh
            - file: /usr/share/bmcgo/wbd-packet/hpm_wbd.config
            - file: /usr/share/bmcgo/wbd-packet/packetwbd.sh
            - file: /usr/share/bmcgo/wbd-packet/update.cfg
    
  2. 执行白牌包构建命令

    cd manifest/build
    bingo publish -z WBD -b openUBMC
    

    输出路径:manifest/output/packet/wbd/wbd_output.zip

  3. 升级该白牌包

    • 通过 Web UI(路径:/UI/Static/#/navigate/manager/upgrade
    • 或使用 ipmcset 命令离线升级
  4. 验证证书是否生效

    • 登录 Web 页面查看证书信息
    • 检查 /data/opt/bmc/conf/customize.pfx 是否存在
    • 查看操作日志是否有导入证书成功记录

:white_check_mark: 方案二:强制手动导入证书(临时方案)

如果无法立即重构打包流程,可尝试手动导入:

# 将 customize.pfx 复制到临时目录
cp /opt/bmc/white_branding/wbd_up_file.tar.gz /tmp/
cd /tmp
tar -xzf wbd_up_file.tar.gz
cp wbd_up_file/customize.pfx /data/opt/bmc/conf/

# 手动触发证书导入(示例命令,具体取决于实现)
bmcssl --import-cert=/data/opt/bmc/conf/customize.pfx --password=""  # 若有密码需填写

注:该方法不具备可维护性,仅用于调试。


:hammer_and_wrench: 验证与排查建议

排查项 操作
:white_check_mark: 检查 wbd_up_file.tar.gz 内容 tar -tzf wbd_up_file.tar.gz | grep customize.pfx
:white_check_mark: 检查 filelist.conf 路径 确保 Path=/data/opt/bmc/conf
:white_check_mark: 检查构建日志 构建过程是否提示缺少 beforeaction.sh 等文件?
:white_check_mark: 检查运行日志 journalctl -u bmc-core 或查看 /var/log/ 下固件升级日志
:white_check_mark: 是否提示“p12 parse fail”? 是 → 证书加密未处理;否 → 关注路径或脚本缺失
:white_check_mark: 是否使用 bmcgo 构建? 否 → 必须切换工具

:pushpin: 总结

问题 原因 解决方案
customize.pfx 未生效 wbd_up_files 仅复制文件,不触发导入逻辑 使用 bmcgo 构建完整白牌包
Web 无响应 未成功加载 SSL 证书,HTTPS 启动失败 手动导入证书或修复打包流程
打包成功但未生效 缺少 update.cfghpm_wbd.configafteraction.sh 等驱动脚本 完善白牌包构建配置
证书解析失败 加密 PFX 未去密 制作证书时先设密再清密导出

:light_bulb: 强烈建议:使用标准白牌包构建流程(bmcgo + wbd_hpms)替代直接的 wbd_up_files 文件注入方式,以确保所有定制内容(包括证书、样式、配置)能够正确部署和生效。


:pushpin: 参考资料:

这个证书和升级预制的证书是相同的吗

是的 同一个证书; 证书我传上来了, 但是一直在社区审批中

再确认一下 web_custom.xml 是否一致呢,目前日志分析是定制的属性 PreSSLSeverCommonName, PreSSLSeverOrgName 或者 PreSSLSeverCountry 有差异。

这个是我的白牌包的内容
customize.tar (27.5 KB)

两种方式的 web_custom.xml 文件定制的 PreSSLSever 相关属性是否是相同的? 主要是看看 PreSSLSeverCountry 是否相同,从日志来看是该字段为空字符串导致的问题。

看起来证书本身没有这个字段, 是否只能重新生成证书?

可以先在 web_custom.xml 中给 PreSSLSeverCountry 填入一个非空值试试。证书正常应该都是包含国家信息的。