Getting error “Error loading private server key”

怎甘沉沦 提交于 2019-12-11 09:39:31

问题


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:


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


来源:https://stackoverflow.com/questions/27177105/getting-error-error-loading-private-server-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!