简体   繁体   中英

GCM XMPP server authentication

I'm trying to implement googls example of GCM server as discribed here: Writing the Server Code

and i'm getting the following error:

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!

My server is behind a NAT and firewall. I've opened a rule for outgoing connection to ANY and forwarded ports 5228-5230, as mentioned here . Though, because of resources issues I can't forward all ports to the server, neither 80 or 443.

Any ideas on what causing this error and can I resolve it?

Thanks.

I'm not sure if that's your only problem, but you opened the wrong ports :

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

The ports that you opened are only required for your Android device to receive messages from the GCM server when your device is connected to the internet via 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM