powershell - CouchDB SSL CRT 到 PEM 文件

标签 powershell ssl https openssl couchdb

我尝试了几种方法来获取一些 PEM 文件以供 CouchDB 使用。我已经使用 powershell 生成了一个证书,使用 key 将其导出到 pfx,然后使用 openssl 转换为 2 个 pem 文件并将它们安装在 Couch 中。使用这种方法它似乎在 IE11 中工作,但它不适用于 firefox 或其他浏览器。 Firefox 产生此错误:

The key does not support the requested operation. (Error code: sec_error_invalid_key)

我还从 ssl.com 获得了免费的 ssl 证书(他们给了我三个 CRT 文件)并尝试使用 openssl 转换它,但无济于事。

我还按照 CouchDB 页面上的说明生成了专门用于此目的的自签名证书,但它不会加载页面。 (http://docs.couchdb.com/en/latest/config/http.html#config-ssl 大约一半)

有人成功过吗?如何将我的证书转换为适合 Couch 以及所有浏览器的格式?

更新: 现在我收到这个错误

A PKCS #11 module returned CKR_DEVICE_ERROR, indicating that a problem has occurred with the token or slot.

不确定这是前进还是倒退......

最佳答案

seems像 CouchDB 1.7 或 1.6 之前的版本一样,不能为证书验证指定中间证书。由于您正在撰写有关收到三个 .crt 文件的文章,因此可能需要其中一些作为中间证书。不了解它们的 CouchDB 可能是您遇到问题的原因。

显然,解决此问题的一种方法是将您的证书文件与中间证书文件连接起来。简单地将它们 cat 在一起

$ cat yours.crt theirs.crt > couchdb.crt

...并使用 CouchDB 的 certfile 配置选项指向 couchdb.crt 的位置。 如果您希望先将 .crt 转换为 .pem,请使用类似的东西

$ openssl openssl x509 -in yours.crt -inform der -outform pem -out yours.pem

在足够新的版本中,您可能可以通过设置 CouchDB 的 cacertfile 选项来使用中间证书。看看this了解更多信息。

关于powershell - CouchDB SSL CRT 到 PEM 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19670788/

相关文章:

node.js - 在本地测试 Instagram Basic API

https - java.lang.Exception : Input not an X. 509 证书:keytool 错误

powershell - 如何从快捷方式文件向 PowerShell 传递多个命令?

Powershell 脚本在 Octopus 中失败

java - Docker Java 应用程序 - SSLHandshakeException/未找到可信证书

wcf - 简单 WCF SSL Web 服务

powershell - 在powershell中打开程序并获取其句柄

powershell - 尝试使用 powershell 将数组导出到 csv(数组对象是 ; 分隔并包含换行符)

magento - 调整机器大小时,SSL 在 Google Cloud Platform 上停止工作

php - 无法使用 file_get_contents 找到包装器 "https"