2017-04-04 137 views
0

我正在爲CKAN安裝datapusher服務。 CKAN已被配置爲使用NGINX反向代理服務器,路由客戶端請求,遵循instructions here。 SSL證書在NGINX中安裝和配置。 當試圖使用datapusher應用上傳一個文件,它失敗和Apache日誌給出了這樣的錯誤:SSL連接無法通過端口8800 Datapusher應用,NGINX反向代理到Apache

Mon Apr 03 13:49:10.979179 2017] [:error] [pid 15468] 2017-04-03 13:49:10,979 CRITI [ckanext.datapusher.plugin] {'status_code': 403, 'message': 'An Error occurred while sending the job: 403 Client Error: Forbidden', 'details': u'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\\n<html><head>\\n<title>403 Forbidden</title>\\n</head><body>\\n<h1>Forbidden</h1>\\n<p>You don\\'t have permission to access /job\\non this server.</p>\\n<hr>\\n<address>Apache/2.4.7 (Ubuntu) Server at 127.0.0.1 Port 8800</address>\\n</body></html>\\n'} 

當測試通過OpenSSL的訪問datapusher的8800端口,這是輸出:

[Mon Apr 03 13:49:10.981049 2017] [:error] [pid 15468] [remote 127.0.0.1:6855] Error - <type 'exceptions.TypeError'>: notify() takes exactly 3 arguments (2 given) 
open:/etc/ckan> openssl s_client -connect 127.0.0.1:8800 
CONNECTED(00000003) 
140385459791520:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:794: 
--- 
no peer certificate available 
--- 
No client certificate CA names sent 
--- 
SSL handshake has read 7 bytes and written 275 bytes 

datapusher文檔提供繞過SSL here的解決方法,使用SSL_Verify配置。我試過這個,沒有任何變化。

我認爲我需要: 1.強制nginx反向代理允許通過端口8800(除了443)的SSL連接。或... 2.配置ckan/datapusher/apache/nginx以繞過端口880上的SSL/https。

有什麼建議嗎?

回答

1

我相信403錯誤是在這一點上,CKAN向DataPusher發送一個請求,要求它加載特定資源。 DataPusher僅在Apache上運行,因此位於HTTP(而不是HTTPS),因此SSL應該沒有問題。檢查CKAN配置是默認:

ckan.datapusher.url = http://127.0.0.1:8800/ 

DataPusher的SSL_VERIFY設置是在以後的請求 - 當datapusher使得在ckan.site_url到CKAN的請求,這對於您將通過nginx的走了過來HTTPS。您可能需要此設置,具體取決於您的python中的SSL是否兼容。閱讀代碼表明你需要引號,並確保密鑰全部大寫。即在您datapusher_settings.py:

SSL_VERIFY = 'False' 
+0

謝謝。我現在已經嘗試了這些設置的所有組合,並且仍然出現相同的錯誤。 –

+0

我標記了一個問題:https://github.com/ckan/datapusher/issues/149 –