Error connecting to Google Cloud Messaging via sockets

Posted by Korak_Schoone on 29-Aug-2013 06:16

Hello,

I'm trying to connect to the Google Cloud Messaging server (GCM) .

This is the code I use:

DEFINE VARIABLE vcHost     AS CHARACTER    INITIAL "android.googleapis.com"   NO-UNDO.
DEFINE VARIABLE vcPort     AS CHARACTER    INITIAL "443"        NO-UNDO. /* Also tried 5228 */
DEFINE VARIABLE vhSocket   AS HANDLE                             NO-UNDO.


CREATE SOCKET vhSocket.
vhSocket:CONNECT('-H ' + vcHost + ' -S ' + vcPort + " -ssl -nohostverify") NO-ERROR.

I get the following error: Secure Socket Layer (SSL) failure. error code 10060: Unknown network error (9318).

I did see KB article 000031248, but this does not solve my problem.

Doe anybody have an idea what I'm doing wrong?

All Replies

Posted by Brian K. Maher on 24-Oct-2013 13:24

Hi Korak,

Did you import the appropriate certificates?

When I run your code and take the NO-ERROR off of the CONNECT call I get the following:

Secure Socket Layer (SSL) failure.  error code -54 : unable to get local issuer certificate for 594f1775.0 in C:\DLC\CERTS (9318)

Sincerely, Brian Maher

Posted by Marian Edu on 28-Oct-2013 03:36

Brian, think would help to actually use the CA name in the error message instead of the hash... not always eazy to find out what is not trusted on the CA tree.

Posted by Brian K. Maher on 28-Oct-2013 06:53

Medu,

Try opening proenv then running sslc s_client -help.  That is a command line utility which you can use to get more details as to what certs we are loading or trying to load.  Use the -connect, -showcerts and -debug parameters to connect to the service and get more info.

Brian

This thread is closed