openssl:他们摘要 sh-512

openssl: unkown digest sha-512

我尝试使用 openssl 创建证书签名请求:

openssl req -key my.key -out out.csr -new -subj "XXXXXXX" -config openssl-san.cnf

但出现此错误:

req: Unknown digest sha-512
req: Use -help for summary.

我在 Ubuntu 18.04 下工作,所有文件都在那里并且是自动生成的,所以我认为配置或关键文件不是问题。

修复您的 openssl-san.cnf 配置文件以将摘要引用为 sha512 而不是 sha-512

看看https://www.openssl.org/docs/manmaster/man1/openssl-req.html

-digest This specifies the message digest to sign the request. Any digest supported by the OpenSSL dgst command can be used. This overrides the digest algorithm specified in the configuration file.

default_md This option specifies the digest algorithm to use. Any digest supported by the OpenSSL dgst command can be used. This option can be overridden on the command line. Certain signing algorithms (i.e. Ed25519 and Ed448) will ignore any digest that has been set.

如果您查看 https://www.openssl.org/docs/manmaster/man1/openssl-dgst.html 它告诉您可以 运行

openssl list --digest-commands

查看哪些摘要及其名称在您的 OpenSSL 构建中可用。

例如:

openssl list --digest-commands

blake2b512        blake2s256        gost              md4
md5               rmd160            sha1              sha224
sha256            sha384            sha512

在命令行或配置文件中,您必须在任何地方使用这些名称。