So I just managed to create my certificates with OpenSSL using the instructions in Docs section.
I was asked to create passwords twice, once for the key i think and once for the .PEM file.
I’ve tried just having a password in the PEM file and having in both. The password is made from numbers and letters
so no special characters. The server keeps throwing this at me:
ERROR - Error initializing ssl context. Reason : File does not contain valid private key: .\server.pem
This is my properties setup
server.ssl.cert=./server.crt
server.ssl.key=./server.pem
server.ssl.key.pass=**********
Am I missing something?
I just copy pasted the commands from docs, added my “data” with names and country codes and passwords.
Copied the files to my Blynk folder and updated the server.properties
OR
you can only do the last cmd to re-generate the pem.
MUST input a password when generating pem. Not just press Enter. (I think you did it already)
Restart the server, and my problem was solved. My server version is 0.24.0.
Don’t forget to update the fingerprint in your sketch if you re-generate a new crt.
@benjaminzhao Thanks,
After few updates I always encounter a failure crash () , It didn’t make a password and previous versions were running just fine. Today when I tried v0.24.1, it gave me that error. Thanks to your reply to @Fettkeewl , I resigned my certificate with password and server started successfully again.
I hope server.properties changes are mentioned whenever server is updated to minimize pulling the remaining pile of hair on my head
Exception in thread “main” java.lang.RuntimeException: File does not contain valid private key: D:\Blynk\server.pem
at cc.blynk.utils.SslUtil.initSslContext(SslUtil.java:71)
at cc.blynk.server.hardware.HardwareSSLServer.(HardwareSSLServer.java:36)
at cc.blynk.server.launcher.ServerLauncher.start(ServerLauncher.java:78)
at cc.blynk.server.launcher.ServerLauncher.main(ServerLauncher.java:70)
Followed your steps, tried with and without password on server.key and both got me this error. So frustrating …
Paths are right, it finds the .pem as per error message.
When generating pem I gave it a password and said password is in the server.properties file. Heeeeeeeeeeeeeelp before I go nanas.
Edit : perhaps I should ask… What is considered a valid key?!