我可以在git bash中使用命令替换吗?

时间:2019-06-24 16:34:46

标签: bash openssl git-bash

我喜欢Git Bash,因为它将所有功能强大的工具放在Windows的CLI上。我正在尝试将其与openssl一起使用以生成csr和密钥。而且,我想用一个命令完成所有操作。这是我到目前为止的内容:

openssl req -new -sha256 \
    -newkey ec:<(openssl ecparam -name prime256v1) -keyout site.key \
    -batch -out site.csr -utf8 \
    -subj '//C=US\ST=State\L=City\O=organization\OU=org unit\CN=site.com\emailAddress=admin@site.com' \
    -addext 'subjectAltName=DNS:site.com,DNS:www.site.com'

我的问题是git bash不能正确处理命令替换(或者我做错了)。当我运行上面的代码时,我得到了

Can't open parameter file /dev/fd/63
15160:error:02001003:system library:fopen:No such process:../openssl-1.1.1a/crypto/bio/bss_file.c:72:fopen('/dev/fd/63','r')
15160:error:2006D080:BIO routines:BIO_new_file:no such file:../openssl-1.1.1a/crypto/bio/bss_file.c:79:

根据the manual

  

所有其他算法都支持 -newkey alg:file 格式,其中file可能是由 genpkey -genparam 命令创建的算法参数文件...

所以,我想我想在ec:之后向其提供文件,但不确定如何。 (顺便说一句,我朝着from this answer的方向前进。尽管它是为标准bash编写的,但我希望它能起作用。)

0 个答案:

没有答案