【问题标题】:In Git-Bash-Windows `openssl pkcs12` does not prompt for password在 Git-Bash-Windows `openssl pkcs12` 中不提示输入密码
【发布时间】:2021-07-20 07:42:29
【问题描述】:

SSL 证书颁发机构向我发送了.pfx 格式的签名证书,并且受密码保护;所以我需要将其转换为.crt 文件。

第一次尝试是调用openssl pkcs12 -in server.pfx -out server.crt -nokeys -clcerts,只是在 Git-Bash Windows 中;但它永远等待,没有输出也没有提示。最终,我切换到 Linux (RHEL7),同样的命令运行良好。事实证明,在 Linux 中,命令提示符“Enter Import Password:”;但是,在 Windows Git-Bash 中运行时,它会丢失密码提示,并且会一直挂在那里。

我想知道是否有任何东西可以让它在 Windows Git-Bash 中工作,例如命令参数等,因为我的工作计算机仍在运行 Windows 操作系统。任何指针将不胜感激。

Linux 屏幕截图:

[root@host]# openssl pkcs12 -in server.pfx -out server.crt -nokeys -clcerts
Enter Import Password:
MAC verified OK
[root@host]#

【问题讨论】:

    标签: windows openssl git-bash pkcs#12


    【解决方案1】:

    首先,在 Windows 10 上,您可以通过 WSL2 切换到您选择的任何 Linus 发行版。

    其次,在 Windows 上,我总是必须在命令行中包含密码:

    openssl pkcs12 -password pass:aPassword -in server.keystore.pfx -nokeys -clcerts -out server.cert
    # or
    openssl pkcs12 -passin pass:aPassword -in server.keystore.pfx -nokeys -clcerts -out server.cert
    

    【讨论】:

    • 感谢您的帮助,@VonC,它有效。我试过-password pass:aPassword-passin pass:aPassword,任何一个都可以。
    • 顺便说一句,我刚刚尝试过 WSL(Linux 的 Windows 子系统)Ubuntu,它也能正常工作。再次感谢您的提示。
    猜你喜欢
    • 2018-03-04
    • 2012-11-04
    • 2013-07-04
    • 1970-01-01
    • 2012-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-08
    相关资源
    最近更新 更多