'Ubuntu 18.04 Problem Making Certificate Request, string too short

I am currently running Ubuntu 18.04 on Hyper-VM, and I need to run a rack proxy server, I am using ruby 2.2.0 and rails 4.2.11.

The first option I found was prax: https://ysbaddaden.github.io/prax/

When I follow the download instructions, and use the command ./bin/prax install, I get the following output:

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:

I am pretty new to all of this, so I am not very familiar with SSL keys, but it seems like the issue is with this file in 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

Not exactly sure where to go from here, I tried generating my own key using sudo openssl genrsa - out *.key 2048, and it worked fine when I ran it. Based on the "string too short error" it seems like one of the required options isn't being passed to the command to generate the key. Any thoughts on how to address this?



Solution 1:[1]

I ended up giving up on prax altogether, and found a better solution. I installed puma-dev using their instructions and got it to work fine: https://github.com/puma/puma-dev

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jgreggq