Forum

Error Loading Private key

Issue
20 January 2017, 06:52
systemctrl reports Error loading private key from /etc/ssl/cert.pem
I followed this
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365
To create a self signed cert
Then I
cp key.pem /etc/ssl/cert.pem
cat cert.pem >> /etc/ssl/cert.pem
I even
chmod 666 /etc/ssl/cert.pem
What is wrong?
Issue
20 January 2017, 08:15
The error message is
hiawatha [17295]: Error loading private key from /etc/ssl/cert.pem
Hugo Leisink
20 January 2017, 09:44
Have you checked the TLS bindings HOWTO?
Issue
23 January 2017, 05:02
Binding {
Port = 443
TLSCertFile = /etc/ssl/cert.pem
TimeForRequest=30
}
Issue
25 January 2017, 03:49
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIIDizCCAnOgAwIBAgIJAIQ/9zbUJshrMA0GCSqGSIb3DQEBCwUAMFwxCzAJBgNV
BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
aWRnaXRzIFB0eSBMdGQxFTATBgNVBAMMDDE5Mi4xNjguMS44MDAeFw0xNzAxMjAw
NTQ4NDdaFw0xODAxMjAwNTQ4NDdaMFwxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApT
b21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxFTAT
BgNVBAMMDDE5Mi4xNjguMS44MDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
ggEBAL+LHdDWBP1UWvtw5OhMdEcFpH4zUvh+z9rPws03YAu7aTn0vwgIf0LXKKAl
BieAdRj2YehJR4hnW4YVlSovikyZI3xSwjhO42cPSyi2A3QoUUTMK4Zv6nk0Jd7o
9yDVKSdO+2RiOJjX7xe4EblTZFL8bM6henRExACtamqdiHKta0DN2icFPel31/US
fAMtweUMTLQfO8yWIvrllf49amxnI3fUcu8mq97yJNKZLPreZtEYgcm7qWM/EU+b
heuqRg+omG7K0U8xWOQ11+p3DRbC7cTjyaRV+A0Yp5h6tqSMUWY9uK7BP0/iWlOz
YEslky43IT4qaQUmFyvLMNQfgLUCAwEAAaNQME4wHQYDVR0OBBYEFIdv4xbQ9svd
INMRVs2LWn18STDcMB8GA1UdIwQYMBaAFIdv4xbQ9svdINMRVs2LWn18STDcMAwG
A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAE/3OJiuqgZnolpOaM+SrW5a
+JFdxik5QAaeaFnYyTTrvG4ouiKichdmIpH927Wdm1Wkf/mVHGzqSKSKgigAKJ/P
YtZS1heQ9+vbPa265/tKRchEvOtDnoGoK+F3rZ4xfjDy0nzNjD2dPdsrl2/oA7c1
h2n8JfAo9Lyc7NpfropgRJGZGdf7J07e7+2AB6dfcP6A0kyDawlamsopWLAVR3EE
H8d8/sq6Rc6QITe1f44auZklYhjOvjViVX2KPADWJMRkRJrqWkyLYGmvOEn4oLot
nm5H1TkJwTLlxgh92DUSpwbG4DFrXmTO1Q4D0/VvhyT/PLUVKBlHSA3xLDJZraI=
-----END CERTIFICATE-----
Hugo Leisink
25 January 2017, 20:22
You realize you posted a private key to a public forum? I advice you to delete it and generate a new one.

Is the private key password protected?
Issue
1 February 2017, 03:32
It is okay I am doing it for testing not a production server.
Key is not protected.
Hugo Leisink
1 February 2017, 08:09
Compile Hiawatha with ENABLE_DEBUG set to ON (in config.h.in, located in root of source package). This will generate a lot of mbed TLS debug information in Hiawatha's system logfile. See if it says anything about the key loading.
This topic has been closed.