我目前在 Hyper-VM 上运行 Ubuntu 18.04,我需要运行 Rack 代理服务器,我使用的是 ruby 2.2.0 和 rails 4.2.11。
我发现的第一个选项是 prax:https://ysbaddaden.github.io/prax/
当我按照下载说明,并使用命令 ./bin/prax install
,我得到以下输出:
make: 'libnss_prax.so.2' is up to date.
ln -sf /opt/prax/ext/libnss_prax.so.2 /lib
Installing Prax firewall rules
/etc/init.d/prax: 19: /etc/init.d/prax: ifconfig: not found
Creating ~/.prax directory
Symlinking prax into /usr/local/bin
Generating SSL key and certificate
problems making Certificate Request
... encoding routines:ASN1_mbstring_ncopy:string too short:../crypto/asn1/a_mbstr.c:100:minsize=2
Can't open server.csr for reading, No such file or directory
... Cant open server.csr for reading, No Such file or directory:../crypto/bio/bss_file.c:72:fopen('server.csr','r')
... :BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:79:
我对这一切都很陌生,所以我对 SSL key 不是很熟悉,但问题似乎出在 Prax 中的这个文件上:#! /usr/bin/env sh
FILE="test_require_sudo"
SUDO=`touch $FILE 2>/dev/null && rm $FILE || echo "sudo"`
if [ ! -e server.key ]; then
$SUDO openssl genrsa -out server.key 2048
fi
if [ ! -e server.csr ]; then
$SUDO openssl req -new -key server.key -out server.csr \
-subj "/C=/ST=/L=/O=Prax Dev Cert/OU=/CN=localhost"
fi
if [ ! -e server.crt ]; then
$SUDO openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
fi
不完全确定从这里去哪里,我尝试使用 sudo openssl genrsa - out *.key 2048
生成我自己的 key ,当我运行它时它运行良好。基于“字符串太短错误”,似乎所需选项之一没有传递给命令以生成 key 。关于如何解决这个问题的任何想法?
最佳答案
我最终完全放弃了 prax,并找到了更好的解决方案。我按照他们的说明安装了 puma-dev 并让它正常工作:https://github.com/puma/puma-dev
关于linux - Ubuntu 18.04 发出证书请求时出现问题,字符串太短,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71022214/