Ssl 获取错误“加载私有服务器密钥时出错”

Ssl 获取错误“加载私有服务器密钥时出错”,ssl,fiware-orion,fiware,Ssl,Fiware Orion,Fiware,因此,我在Orion Context Broker服务器实例中实现了rush,每当我尝试使用以下命令启动contextBroker时: contextBroker -rush localhost:1234 -https -key privkey.pem -cert cert.csr openssl req -new -key privkey.pem -out cert.csr ,我得到以下错误: E@18:16:11 loadFile[1101]: error opening 'priv

因此,我在Orion Context Broker服务器实例中实现了rush,每当我尝试使用以下命令启动contextBroker时:

contextBroker -rush localhost:1234 -https -key privkey.pem -cert cert.csr
openssl req -new -key privkey.pem -out 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'
我使用以下命令生成了私钥,我不知道它是否正确:

openssl genrsa -des3 -out privkey.pem 2048
我使用以下命令生成了我的证书:

contextBroker -rush localhost:1234 -https -key privkey.pem -cert cert.csr
openssl req -new -key privkey.pem -out cert.csr

我做错什么了吗?

您必须使用绝对路径名,即:

contextBroker -rush localhost:1234 -https -key /path/to/privkey.pem -cert /path/to/cert.csr
为了更清楚地说明这一点,已添加了注释

此外,您可能会发现有关如何生成所需文件的有用信息:

...
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