MAC PKCS12 导入期间验证失败(密码错误?)/Azure Devops
MAC verification failed during PKCS12 import (wrong password?) / Azure Devops
我正在使用 Azure DevOps 中的 InstallAppleCertificate@2 任务,但每次我尝试 运行 都会弹出此错误
security: SecKeychainItemImport: MAC verification failed during PKCS12 import (wrong password?)
这是我正在使用的任务
- task: InstallAppleCertificate@2
inputs:
certSecureFile: "${{ parameters.certificateSecureFileName }}"
certPwd: "${{ parameters.certificatePassword }}"
displayName: "Install AdHoc Certificate"
我很确定密码是正确的,因为我在本地尝试了相同的命令并且成功了。密码不包含任何特殊字符,并存储在变量组中。
如有任何帮助,我们将不胜感激。谢谢
OpenSSL 3.x 在 pkcs12
中更改了其默认算法。这与 macOS/iOS 中的嵌入式安全框架不兼容。您也可以使用 OpenSSL 1.x.
参见:
- Change default algorithms in PKCS12_create() and PKCS12_set_mac()
- MacOS security framework fails to import RFC 7292 compliant PKCS #12 v1.1 file into keychain using modern cyphers
致 macOS 用户:如果您正在使用通过 Homebrew 安装的 openssl@3
命令行工具,请降级到 openssl@1.1
并在 ~/.zshrc
中修改您的 PATH
。例如:
export PATH="/opt/homebrew/opt/openssl@3/bin:$PATH"
export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"
如果您将 openssl@3
库(libcrypto
和 libssl
)与 SecKeychainItemImport
或 SecPKCS12Import
一起使用,请查看上面的提交页面并对您的代码进行一些修改。
我正在使用 Azure DevOps 中的 InstallAppleCertificate@2 任务,但每次我尝试 运行 都会弹出此错误
security: SecKeychainItemImport: MAC verification failed during PKCS12 import (wrong password?)
这是我正在使用的任务
- task: InstallAppleCertificate@2
inputs:
certSecureFile: "${{ parameters.certificateSecureFileName }}"
certPwd: "${{ parameters.certificatePassword }}"
displayName: "Install AdHoc Certificate"
我很确定密码是正确的,因为我在本地尝试了相同的命令并且成功了。密码不包含任何特殊字符,并存储在变量组中。
如有任何帮助,我们将不胜感激。谢谢
OpenSSL 3.x 在 pkcs12
中更改了其默认算法。这与 macOS/iOS 中的嵌入式安全框架不兼容。您也可以使用 OpenSSL 1.x.
参见:
- Change default algorithms in PKCS12_create() and PKCS12_set_mac()
- MacOS security framework fails to import RFC 7292 compliant PKCS #12 v1.1 file into keychain using modern cyphers
致 macOS 用户:如果您正在使用通过 Homebrew 安装的 openssl@3
命令行工具,请降级到 openssl@1.1
并在 ~/.zshrc
中修改您的 PATH
。例如:
export PATH="/opt/homebrew/opt/openssl@3/bin:$PATH"
export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"
如果您将 openssl@3
库(libcrypto
和 libssl
)与 SecKeychainItemImport
或 SecPKCS12Import
一起使用,请查看上面的提交页面并对您的代码进行一些修改。