【问题标题】:Azure App Service unable to validate .pfx file: Certificate failed validation because it could not be loadedAzure 应用服务无法验证 .pfx 文件:证书验证失败,因为无法加载
【发布时间】:2022-07-16 12:57:02
【问题描述】:

多年来,我能够使用this StackOverflow answer 中的 OpenSSL 创建方法上传新的 pfx 文件以在 Azure 应用服务上进行 SSL 绑定:

openssl pkcs12 -export -out domain.name.pfx -inkey domain.name.key -in domain.name.crt

但是,现在执行相同操作会出现此错误:

至少一个证书无效(证书验证失败,因为无法加载。)

有什么方法可以解决这个问题?

【问题讨论】:

    标签: azure ssl azure-web-app-service certificate pfx


    【解决方案1】:

    打开 PowerShell 并运行此命令,将 -FilePath 替换为非工作 pfx 文件的路径,并将密码 -String 参数替换为其各自的密码:

    Import-PfxCertificate -FilePath "pfx file path" -CertStoreLocation Cert:\LocalMachine\My -Password (ConvertTo-SecureString -String 'MyPassword' -AsPlainText -Force) -Exportable
    

    成功的输出如下所示:

    使用此指纹将证书导出到新的 pfx 文件,替换 -Cert-FilePath 和密码 -String 参数:

    Export-PfxCertificate -Cert Microsoft.PowerShell.Security\Certificate::LocalMachine\My\B56CE9B122FB04E29A974A4D0DB3F6EAC2D150C0 -FilePath 'newPfxName.pfx' -Password (ConvertTo-SecureString -String 'MyPassword' -AsPlainText -Force)
    

    Azure 现在应该能够验证新的 pfx 文件了。

    【讨论】:

      猜你喜欢
      • 2018-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-07
      相关资源
      最近更新 更多