获取错误“加载私人服务器密钥时出错"; [英] Getting error "Error loading private server key"
本文介绍了获取错误“加载私人服务器密钥时出错";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
因此,我在Orion Context Broker Server实例中以及在每次尝试使用以下命令启动contextBroker时都实施rush:
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
,出现以下错误:
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
我做错什么了吗?
推荐答案
您必须使用绝对路径名,即:
You have to use absolute path names, i.e.:
contextBroker -rush localhost:1234 -https -key /path/to/privkey.pem -cert /path/to/cert.csr
已将注释添加到 CLI命令文件化使其更加清晰.
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
这篇关于获取错误“加载私人服务器密钥时出错";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文