Getting error “Error loading private server key”

2019-08-09 11:00发布

So I was implementing rush in Orion Context Broker Server instance, and whenever I try to start the contextBroker with the following command:

contextBroker -rush localhost:1234 -https -key privkey.pem -cert cert.csr

, I'm getting the following error:

 E@18:16:11  loadFile[1101]: error opening 'privkey.pem': No such file or directory
 X@18:16:11  main[1258]: Error loading private server key from 'privkey.pem'

I generated my private key with the following command, I don't know if it's correct:

openssl genrsa -des3 -out privkey.pem 2048

And I generated my certificate with the following command:

openssl req -new -key privkey.pem -out cert.csr

Do I'm doing something wrong?

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-08-09 12:03

You have to use absolute path names, i.e.:

contextBroker -rush localhost:1234 -https -key /path/to/privkey.pem -cert /path/to/cert.csr

A note has been added to CLI commands documenation to make this clearer.

In addition, you may find useful the following script on how to generate the needed files:

...
openssl genrsa -out "$keyFileName" 1024 > /dev/null 2>&1
openssl req -days 365 -out "$certFileName" -new -x509 -key "$keyFileName" -subj "$OPTIONS" > /dev/null 2>&1
查看更多
登录 后发表回答