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