2

我試圖執行的GCM服務器的googls例如爲discribed這裏: Writing the Server CodeGCM XMPP服務器認證

,我發現了以下錯誤:

DEBUG: socket  sent <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">...</auth> 
DEBUG: socket  error Socket error while receiving data 
Traceback (most recent call last): 
    File "/usr/lib/python2.6/dist-packages/xmpp/transports.py", line 146, in receive 
    try: received = self._recv(BUFLEN) 
SSLError: [Errno 8] _ssl.c:1325: EOF occurred in violation of protocol 
DEBUG: socket  error Socket operation failed 
Authentication failed! 

我的服務器是在NAT後面和防火牆。我已經打開了一個出站連接到ANY的規則,並轉發了端口5228-5230,如here所述。不過,由於資源問題,我不能轉發所有端口到服務器,無論是80或443

任何想法是什麼造成這個錯誤,我可以解決這個問題?

謝謝。

+0

經常xmpppy的SSL錯誤是由xmpppy真的很舊的事實引起的。 http://stackoverflow.com/a/37017182/267540 – e4c5

回答

0

我不知道如果這是你唯一的問題,但你打開了錯誤的端口:

GCM Cloud Connection Server (CCS) is an XMPP endpoint, running on http://gcm.googleapis.com port 5235.

你打開只需要爲你的Android設備從GCM服務器收到消息時,該端口的設備通過WiFi連接到互聯網:

Note: If your organization has a firewall that restricts the traffic to or from the Internet, you need to configure it to allow connectivity with GCM in order for your Android devices to receive messages. The ports to open are: 5228, 5229, and 5230. GCM typically only uses 5228, but it sometimes uses 5229 and 5230. GCM doesn't provide specific IPs, so you should allow your firewall to accept outgoing connections to all IP addresses contained in the IP blocks listed in Google's ASN of 15169.

+0

我這樣做,不幸的是它沒有工作,仍然有這個錯誤。 我也綁定從服務器和網關嗅探數據包,它似乎不像是由包丟失造成的這個錯誤。 – SMD