gpt4 book ai didi

powershell - CouchDB SSL CRT 到 PEM 文件

转载 作者:太空宇宙 更新时间:2023-11-03 13:41:35 25 4
gpt4 key购买 nike

我尝试了几种方法来获取一些 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com