代码之家  ›  专栏  ›  技术社区  ›  Ricardo

本地SSL证书返回错误“结果太小”,“获取密码时出现问题”

  •  1
  • Ricardo  · 技术社区  · 7 年前

    我正在尝试在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 . . .
    

    制作证书.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 (就像有些人对其他相关的SO问题提出的建议)。

    我用这个问题在google上发了几个小时的垃圾邮件,没有堆栈溢出的答案似乎也有帮助。

    添加一个图像以显示即使使用全新的 pem 质子交换膜 文件名已更改为 privkey77.pem 为了测试的目的,我得到了同样的错误。

    enter image description here 巴布亚新几内亚

    甚至用密码创建新密钥 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

    所以我基本上不能创造 质子交换膜 由于某些原因,带有密码的文件。

    有人能帮忙吗?

    1 回复  |  直到 7 年前
        1
  •  2
  •   Fran Cano    7 年前

    我通过传递 -nodes arg到触发错误的行,如所建议的 here

    我的 makecert.bat

    bin\openssl req -new -out server.csr -nodes

    此参数将完全禁用身份验证。我不知道这在证书中是否有任何副作用,因为我还没能成功,我也不知道为什么。(也许是因为这个,也许是别的原因)

    推荐文章