2014-11-25 149 views
0

我已經在Windows 7 x64上安裝了CouchDB。 我試圖透過SSL端口6984.CouchDB for Windows - 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版本中。

+1

同樣的問題在這裏..你是否能夠在Windows上使用SSL運行CouchDB? – oliverdm 2015-04-10 13:51:16

回答

0

我有同樣的問題和相同的症狀,但有一點是肯定的證書的路徑是關閉的。

您需要使用證書的實際「Windows」路徑,並且如果有空格(即c:\ Program Files(x86)\ Apa .....),請在整個路徑中使用單引號。應該可以用路徑中的'/'替換'\'。