SocketException while retrieving Google Docs with Securetoken(secure=1)

28 views
Skip to first unread message

George

unread,
Jul 5, 2011, 6:04:53 AM7/5/11
to google-docum...@googlegroups.com
Hi,

I am trying to retrieve Google documents by using secure session token(secure=1) after authenticating with OAuth 1.0(By the way i am exchanging the token to session token). We have even registered our domain as mentioned here and hence i guess we could use secure=1. When retrieving the feed i am getting a SocketException as below
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1112)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1139)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1123)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:488)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:515)
at com.google.gdata.client.Service.getFeed(Service.java:1053)
at com.google.gdata.client.Service.getFeed(Service.java:995)
at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:662)
at com.google.gdata.client.Service.getFeed(Service.java:952)
at com.company.xx.client.docs.GetGoogleDocs.execute(GetGoogleDocs.java:277)
 
The same code works fine when retrieved using non-secure token(secure=0). This exception is thrown in our servers that reside in China. Is it this what is causing the problem? As the same code is working fine in our servers that are present in India. To check if I could establish connection to Google Docs from these chinese servers, I tried to wget "https://docs.google.com" and it shows "Unable to establish SSL connection"
--2011-07-05 17:39:44--  https://docs.google.com/
Resolving docs.google.com... 74.125.71.139, 74.125.71.100, 74.125.71.101, ...
Connecting to docs.google.com|74.125.71.139|:443... connected.
Unable to establish SSL connection.
It would be great if someone could help me resolving this issue.

TIA,
George

Ali Afshar

unread,
Jul 5, 2011, 3:36:01 PM7/5/11
to google-docum...@googlegroups.com
Hi George,

I'm not entirely sure, but could this be an SSL certificate issue? If
neither wget nor the API library are working, perhaps your server has
not have registered the correct Certificate Authorities to verify the
SSL certificate used by the Docs server. This is just a guess, so
sorry if it is totally wrong, but you should be able to wget
https://docs.google.com without error (and I guess you can fetch it
from your other servers?).

Regards

--
Ali Afshar | @aliafshar | Google Developer Relations

George

unread,
Jul 12, 2011, 7:32:10 AM7/12/11
to google-docum...@googlegroups.com
Hi Afshar,

We couldn't resolve this issue yet. Interestingly, I could retrieve Google Calendar events and Google contacts and in this case wget also works fine. Any pointers on why it doesn't work for Google docs would be helpful

TIA,
George
Reply all
Reply to author
Forward
0 new messages