Forum

SSL Cer

Nath
11 April 2014, 01:54
Hello,
I followed step by step tuto to add SSL support, but everytime I try to reload server I have this message:

Starting webserver: Error loading RSA private key (-0x2E00): PK - Read/write of file failed
error!

I checked in Hiawatha .pem file path it's: /etc/hiawatha/serverkey.pem like in tuto (https://www.hiawatha-webserver.org/howto/bindings)

and .pem file is chmod 400, I also tried chmod 700

I created the file with copy / paste of the how to..; So I don't know what to do now to make it work


Hiawatha version: 9.4
Operating System: Ubuntu TLE 12.04
Hugo Leisink
11 April 2014, 10:17
Does the .pem file contain the private key? Hiawatha requires both private key and the certificate to be present in the same file.
Nath
11 April 2014, 13:08
I've got my own certificate with CA ect...

Because it didn't work, I tried this:

openssl genrsa -out serverkey.pem 2048
openssl req -new -x509 -days 3650 -key serverkey.pem -out server.crt
echo "" >> serverkey.pem
cat server.crt >> serverkey.pem
echo "" >> serverkey.pem
rm -f server.crt

for testing purpose... but still not working... quite strange because it's from official HOW TO...
Nath
12 April 2014, 09:44
I fixed the problem,

I just had an error in my hiawatha config file:

SSLcertFile = SSLcertFile = /etc/hiawatha/serverkey.pem

changed to:

SSLcertFile = /etc/hiawatha/serverkey.pem
This topic has been closed.