2013-07-24 93 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