2013-07-24 80 views
1

我正在关注文件https://developers.google.com/drive/push以接收Google云端硬盘的推送通知。没有收到谷歌云端硬盘推送通知

  1. 我的域已注册(位于API控制台的API访问面板中)。
  2. 我在htpps(使用自签名证书)监听的注册域中有一个自定义程序。 https://myveryowndomain.bc.com/drive/notifications
  3. 为任何更改正确创建通知通道(获取响应代码200)。
  4. 我在我的Google云端硬盘文件中进行了更改,但是没有任何内容涉及到,甚至没有同步消息。

我错过了什么吗?

CONFIG: -------------- REQUEST -------------- 
POST https://www.googleapis.com/drive/v2/changes/watch 
Accept-Encoding: gzip 
Authorization: Bearer 1/QRYL1ZHO4KyUmjkbHVWXCWglxJ5e6-xxxxxxxxxxxxx 
User-Agent: push-test-project Google-HTTP-Java-Client/1.15.0-rc (gzip) 
Content-Type: application/json; charset=UTF-8 
Content-Length: 150 

Jul 24, 2013 6:02:04 PM com.google.api.client.http.HttpRequest execute 
CONFIG: curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'Authorization: Bearer 1/QRYL1ZHO4KyUmjkbHVWXCWglxJ5e6-xxxxxxxxxxxxx' -H 'User-Agent: push-test-project Google-HTTP-Java-Client/1.15.0-rc (gzip)' -H 'Content-Type: application/json; charset=UTF-8' -d '@-' -- 'https://www.googleapis.com/drive/v2/changes/watch' << $$$ 
Jul 24, 2013 6:02:04 PM com.google.api.client.util.LoggingByteArrayOutputStream close 
CONFIG: Total: 155 bytes 
Jul 24, 2013 6:02:04 PM com.google.api.client.util.LoggingByteArrayOutputStream close 
CONFIG: {"address":"https://myveryowndomain.bc.com/drive/notifications","id":"f143f7ba-759a-42b8-8748-e39a71ba13cc","type":"web_hook"} 
Jul 24, 2013 6:02:08 PM com.google.api.client.http.HttpResponse <init> 


CONFIG: -------------- RESPONSE -------------- 
HTTP/1.1 200 OK 
ETag: "RFvxxXV9yoZniidCHgcusodAlXI/AaEAn8d9Ma5bpJZNmM0F72Crxxx" 
Content-Length: 247 
X-XSS-Protection: 1; mode=block 
Expires: Fri, 01 Jan 1990 00:00:00 GMT 
Server: GSE 
X-Content-Type-Options: nosniff 
Pragma: no-cache 
Cache-Control: no-cache, no-store, max-age=0, must-revalidate 
X-Frame-Options: SAMEORIGIN 
Date: Wed, 24 Jul 2013 09:02:08 GMT 
Content-Encoding: gzip 
Content-Type: application/json; charset=UTF-8 

Jul 24, 2013 6:02:08 PM com.google.api.client.util.LoggingByteArrayOutputStream close 
CONFIG: Total: 296 bytes 
Jul 24, 2013 6:02:08 PM com.google.api.client.util.LoggingByteArrayOutputStream close 
CONFIG: { 
"kind": "api#channel", 
"id": "f143f7ba-759a-42b8-8748-e39a71ba13cc", 
"resourceId": "_X2yFKJJ6yLq3eIrw3OSxxxxxxx", 
"resourceUri": "https://www.googleapis.com/drive/v2/changes?includeDeleted=true&includeSubscribed=true&maxResults=100&alt=json", 
"token": "", 
"expiration": "1374660126357" 
} 
+0

是_Expires:Fri,1990年1月1日00:00:00 GMT_中的回复正常吗? – user454322

+0

有效期为'Wed,24 Jul 2013 10:02:06 GMT'。 –

回答

2

自签名SSL似乎是这里的问题。这不仅仅是加密。这也是关于信任问题。 你可以从StartSSLCACert获得免费的SSL。

仅供参考,到期标头不是通道的到期时间。这是关于缓存的信息。 您可以在响应主体的“过期”字段中找到您的真实到期时间。它以unix时间格式表示,您的回复“1374660126357”实际上是“周三,4月1日45531 03:05:57 GMT”。更改频道的默认到期时间为1周。

+2

1)如果文档中提到自签名证书不够,那将会很好。 2)即使考虑到隐私和安全性,为开发目的设置真正的SSL也有点过分。 3)能够看到谷歌侧记录(在API控制台或其他地方)的通知将是很大的帮助。例如,_invalid certificate error_,_notification发送到https://myveryowndomain.bc.com/drive/notifications_ – user454322