我试图在XAMPP、Windows 10上安装SSL证书,但是无论我做什么,我都会得到以下错误:
22632:error:28069065:lib(40):UI_set_result:result too small:.\crypto\ui\ui_lib.c:830:You must type in 4 to 511 characters
22632:error:0906406D:PEM routines:PEM_def_callback:problems getting password:.\crypto\pem\pem_lib.c:116:
22632:error:0907E06F:PEM routines:DO_PK8PKEY:read key:.\crypto\pem\pem_pk8.c:130:
unable to load Private Key
18224:error:0906D06C:PEM routines:PEM_read_bio:no start line:.\crypto\pem\pem_lib.c:707:Expecting: ANY PRIVATE KEY
server.csr: No such file or directory
Could Not Find c:\xampp\apache\server.csr
The system cannot find the file specified.
The system cannot find the file specified.
-----
Das Zertifikat wurde erstellt.
The certificate was provided.
Press any key to continue . . .makecert.bat:
@echo off
set OPENSSL_CONF=./conf/openssl.cnf
if not exist .\conf\ssl.crt mkdir .\conf\ssl.crt
if not exist .\conf\ssl.key mkdir .\conf\ssl.key
bin\openssl req -new -out server.csr
bin\openssl rsa -in privkey.pem -out server.key
bin\openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 365
set OPENSSL_CONF=
del .rnd
del privkey.pem
del server.csr
move /y server.crt .\conf\ssl.crt
move /y server.key .\conf\ssl.key
pause看起来server.crt,server.csr和server.key都是创建的,他们坐在conf/sll中.正如makecert.bat中所述,我也尝试过其他密码,但没有成功。
设置set OPENSSL_CONF=C:\xampp\apache\conf\openssl.cnf也没有帮助,也没有将openssl.cnf更改为openssl.cfg (就像一些人在其他相关问题上所建议的那样)。
我用这个问题在谷歌上发了几个小时的垃圾邮件,没有堆叠溢出的答案似乎也有帮助。
编辑:添加了一个图像,以显示即使在一个全新的pem文件中也会出现这个问题。(出于测试目的,我将pem文件名更改为privkey77.pem,显然也有相同的错误)。

png
编辑#2:甚至创建了一个带有密码的新密钥,openssl genrsa -des3 -out mykey.pem 2048返回:27492:error:28069065:lib(40):UI_set_result:result too small:.\crypto\ui\ui_lib.c:830:You must type in 4 to 1023 characters。
因此,由于某种原因,我基本上无法创建带有密码的pem文件。
有人能帮忙吗?
发布于 2018-07-26 15:21:14
我通过将-nodes arg传递给触发错误的行(如建议的here )来避免此错误。
在第7行中,我的makecert.bat文件如下所示:
bin\openssl req -new -out server.csr -nodes
此参数完全禁用身份验证。我不知道这是否在证书中有任何副作用,因为我没有设法使它工作,我也不知道为什么。(可能是因为这个,也可能是别的原因)
https://stackoverflow.com/questions/50613724
复制相似问题