gpt4 book ai didi

windows - 适用于 Windows 的 CouchDB - SSL 证书 - 连接错误

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

我已经在 Windows 7 x64 上安装了 CouchDB。我正在尝试在端口 6984 上使用 SSL 运行 CouchDB。

我准备了文档中的证书:secure-socket-level-options

同时检查:CouchDB Wiki

当我重新启动服务器时,使用:

curl http://127.0.0.1:5984/_restart -X POST

日志显示,6984端口正在监听:

[Tue, 25 Nov 2014 10:15:48 GMT] [debug] [<0.1208.0>] 'POST' /_restart {1,1} from "127.0.0.1"
Headers: [{'Accept',"*/*"},
{'Authorization',"Basic dG9tOnBhcw=="},
{'Content-Type',"application/json"},
{'Host',"127.0.0.1:5984"},
{'User-Agent',"curl/7.38.0"}]
[Tue, 25 Nov 2014 10:15:48 GMT] [debug] [<0.1208.0>] OAuth Params: []
[Tue, 25 Nov 2014 10:15:48 GMT] [info] [<0.1208.0>] 127.0.0.1 - - POST /_restart 202
[Tue, 25 Nov 2014 10:15:50 GMT] [info] [<0.1957.0>] Apache CouchDB has started on http://127.0.0.1:5984/
[Tue, 25 Nov 2014 10:15:50 GMT] [info] [<0.1957.0>] Apache CouchDB has started on https://127.0.0.1:6984/

我修改了local.ini,就像文档说的那样:

[daemons]
; enable SSL support by uncommenting the following line and supply the PEM's below.
; the default ssl port CouchDB listens on is 6984
httpsd = {couch_httpd, start_link, [https]}

[ssl]
;cert_file = C:/Program\ Files\ (x86)/Apache\ Software\ Foundation/CouchDB/etc/Cert/localhost.crt
;key_file = C:/Program\ Files\ (x86)/Apache\ Software\ Foundation/CouchDB/etc/Cert/localhost.pem
cert_file = C:/Program\ Files\ (x86)/Apache\ Software\ Foundation/CouchDB/etc/couchdb/localhost.crt
key_file = C:/Program\ Files\ (x86)/Apache\ Software\ Foundation/CouchDB/etc/couchdb/localhost.pem
;cert_file = /etc/Cert/localhost.crt
;key_file = /etc/Cert/localhost.pem
;key_file = /etc/couchdb/localhost.pem
;cert_file = /etc/couchdb/couchdb.pem
port = 6984
;password = pass:a
; set to true to validate peer certificates
verify_ssl_certificates = false
; Path to file containing PEM encoded CA certificates (trusted
; certificates used for verifying a peer certificate). May be omitted if
; you do not want to verify the peer.
;cacert_file = /full/path/to/cacertf
; The verification fun (optional) if not specified, the default
; verification fun will be used.
;verify_fun = {Module, VerifyFun}
; maximum peer certificate depth
ssl_certificate_max_depth = 1

重启服务后,我无法连接到端口 6984 上的服务器:

curl -k -v https://127.0.0.1:6984
* Rebuilt URL to: https://127.0.0.1:6984/
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 6984 (#0)
* SSLv3, TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to 127.0.0.1:6984
* Closing connection 0
curl: (35) Unknown SSL protocol error in connection to 127.0.0.1:6984

有什么东西,我错过了什么,我没有被检查吗? CouchDB 的版本是 1.6.1。

最佳答案

我有同样的问题和同样的症状,但有一点可以肯定,您的证书路径偏离了。

您需要使用证书的实际“Windows”路径,如果有空格(即 c:\Program Files(x86)\Apa.....),请在整个路径周围使用单引号。把路径中的'\'换成'/'应该就可以了。

关于windows - 适用于 Windows 的 CouchDB - SSL 证书 - 连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27124507/

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