Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails rails精简服务器无法启动-证书太小_Ruby On Rails_Ssl_Certificate_Thin - Fatal编程技术网

Ruby on rails rails精简服务器无法启动-证书太小

Ruby on rails rails精简服务器无法启动-证书太小,ruby-on-rails,ssl,certificate,thin,Ruby On Rails,Ssl,Certificate,Thin,升级到Ubuntu 20后,我无法再以ssl模式运行精简服务器: thin start --ssl 服务器启动正常,但当我使用它时,我得到: 140107127297856:error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small:../ssl/ssl_rsa.c:310: ruby /home/kevin/.rvm/gems/ruby-2.5.0/bin/thin start --ssl: ssl.cpp:203

升级到Ubuntu 20后,我无法再以ssl模式运行精简服务器:

thin start --ssl
服务器启动正常,但当我使用它时,我得到:

140107127297856:error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small:../ssl/ssl_rsa.c:310:
ruby /home/kevin/.rvm/gems/ruby-2.5.0/bin/thin start --ssl: ssl.cpp:203:   SslContext_t::SslContext_t(bool, const string&, const string&, const string&, const string&, const string&, int): Assertion `e > 0' failed.
我已尝试修改/etc/ssl/openssl.cnf以添加

DEFAULT@SECLEVEL=1
但是没有运气。有没有办法解决这个问题

谢谢,
Kevin

您需要生成证书,然后指向这些证书

生成的证书(我们将在稍后讨论)可以保存在任何地方,但我将选择将其保存在项目根目录中的.ssl文件夹中

按照以下步骤生成证书

$openssl genrsa 2048>host.key
$chmod 400 host.key
$openssl req-new-x509-nodes-sha256-days 365-key host.key-out host.cert
上述命令将生成两个文件

  • 主机密钥
  • 主机证书
然后运行以下命令启动精简服务器


精简启动--ssl--ssl密钥文件=.ssl/host.key--ssl证书文件=.ssl/host.cert

您找到了吗?