【问题标题】:rails thin server cannot start - certificate too smallrails瘦服务器无法启动-证书太小
【发布时间】:2020-08-26 01:20:49
【问题描述】:

升级到 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

但没有运气。任何想法如何解决?

谢谢, 凯文

【问题讨论】:

  • 你发现了吗?

标签: ruby-on-rails ssl certificate thin


【解决方案1】:

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

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

按照以下步骤生成证书

  $ openssl genrsa 2048 > host.key
  $ chmod 400 host.key
  $ openssl req -new -x509 -nodes -sha256 -days 365 -key host.key -out host.cert

以上命令会生成两个文件

  • host.key
  • host.cert

然后通过运行以下命令启动您的瘦服务器

thin start --ssl --ssl-key-file=.ssl/host.key --ssl-cert-file=.ssl/host.cert

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-06
    • 2011-06-19
    相关资源
    最近更新 更多