Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1499

Why does Google Calendar.Events.Watch say my request is not HTTPS

$
0
0

I'm currently working on an app using Google Calendar API.

I'm completely stuck when requesting the Watch content because Google says the URI I've specified for the Channel content is not HTTPS :

2025-01-10 10:49:32 app-1           | 2025-01-10 09:49:32,068 CONFIG [com.goo.api.cli.htt.HttpTransport] (executor-thread-1) -------------- REQUEST  --------------2025-01-10 10:49:32 app-1           | POST https://www.googleapis.com/calendar/v3/calendars/primary/events/watch2025-01-10 10:49:32 app-1           | Accept-Encoding: gzip2025-01-10 10:49:32 app-1           | Authorization: <Not Logged>2025-01-10 10:49:32 app-1           | User-Agent: OptimeApp Google-API-Java-Client/2.0.0 Google-HTTP-Java-Client/1.45.0 (gzip)2025-01-10 10:49:32 app-1           | x-goog-api-client: gl-java/21.0.5 gdcl/2.0.0 linux/5.15.1672025-01-10 10:49:32 app-1           | Content-Type: application/json; charset=UTF-82025-01-10 10:49:32 app-1           | Content-Encoding: gzip2025-01-10 10:49:32 app-1           | 2025-01-10 10:49:32 app-1           | 2025-01-10 09:49:32,068 CONFIG [com.goo.api.cli.htt.HttpTransport] (executor-thread-1) curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'Authorization: <Not Logged>' -H 'User-Agent: OptimeApp Google-API-Java-Client/2.0.0 Google-HTTP-Java-Client/1.45.0 (gzip)' -H 'x-goog-api-client: gl-java/21.0.5 gdcl/2.0.0 linux/5.15.167' -H 'Content-Type: application/json; charset=UTF-8' -H 'Content-Encoding: gzip' -d '@-' -- 'https://www.googleapis.com/calendar/v3/calendars/primary/events/watch'<< $$$2025-01-10 10:49:32 app-1           | 2025-01-10 09:49:32,071 DEBUG [sun.net.www.pro.htt.HttpURLConnection] (executor-thread-1) sun.net.www.MessageHeader@614f3e811 pairs: {POST /calendar/v3/calendars/primary/events/watch HTTP/1.1: null}{Accept-Encoding: gzip}{Authorization: Bearer ya29.a0ARW5m75hrpAH13pHKKNu2-0GDitnKSWXNZ3XxVeZjjxAyU-udYVlYYzhXTCStnaRc4L3cnL9S0TInlvpUu-9qOXhLdKaUhc-yonvuxI67yKA9AsqYuXdI-AGKEbfy06vshtztOxx5eUDkuIFAW_92bfMj-tZlP7SJj35aCgYKAV0SARESFQHGX2MiPWyWyY9qojLScOSuKVuk0A0171}{User-Agent: OptimeApp Google-API-Java-Client/2.0.0 Google-HTTP-Java-Client/1.45.0 (gzip)}{x-goog-api-client: gl-java/21.0.5 gdcl/2.0.0 linux/5.15.167}{Content-Type: application/json; charset=UTF-8}{Content-Encoding: gzip}{Host: www.googleapis.com}{Accept: */*}{Connection: keep-alive}{Transfer-Encoding: chunked}2025-01-10 10:49:32 app-1           | 2025-01-10 09:49:32,079 CONFIG [com.goo.api.cli.htt.HttpTransport] (executor-thread-1) Total: 110 bytes2025-01-10 10:49:32 app-1           | 2025-01-10 09:49:32,079 CONFIG [com.goo.api.cli.htt.HttpTransport] (executor-thread-1) {"id":"ChannelID","resourceUri":"https://example.com/optime/googlecalendar/notifications","type":"web_hook"}2025-01-10 10:49:32 app-1           | 2025-01-10 09:49:32,226 DEBUG [sun.net.www.pro.htt.HttpURLConnection] (executor-thread-1) sun.net.www.MessageHeader@6e009cd114 pairs: {null: HTTP/1.1 400 Bad Request}{Vary: Origin}{Vary: X-Origin}{Vary: Referer}{Content-Type: application/json; charset=UTF-8}{Content-Encoding: gzip}{Date: Fri, 10 Jan 2025 09:49:32 GMT}{Server: ESF}{X-XSS-Protection: 0}{X-Frame-Options: SAMEORIGIN}{X-Content-Type-Options: nosniff}{Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000}{x-l2-request-path: l2-managed-14}{Transfer-Encoding: chunked}2025-01-10 10:49:32 app-1           | 2025-01-10 09:49:32,229 CONFIG [com.goo.api.cli.htt.HttpTransport] (executor-thread-1) -------------- RESPONSE --------------2025-01-10 10:49:32 app-1           | HTTP/1.1 400 Bad Request2025-01-10 10:49:32 app-1           | X-Frame-Options: SAMEORIGIN2025-01-10 10:49:32 app-1           | Transfer-Encoding: chunked2025-01-10 10:49:32 app-1           | Server: ESF2025-01-10 10:49:32 app-1           | Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=25920002025-01-10 10:49:32 app-1           | X-Content-Type-Options: nosniff2025-01-10 10:49:32 app-1           | Content-Encoding: gzip2025-01-10 10:49:32 app-1           | Vary: Origin2025-01-10 10:49:32 app-1           | Vary: X-Origin2025-01-10 10:49:32 app-1           | Vary: Referer2025-01-10 10:49:32 app-1           | X-XSS-Protection: 02025-01-10 10:49:32 app-1           | Date: Fri, 10 Jan 2025 09:49:32 GMT2025-01-10 10:49:32 app-1           | Content-Type: application/json; charset=UTF-82025-01-10 10:49:32 app-1           | x-l2-request-path: l2-managed-142025-01-10 10:49:32 app-1           | 2025-01-10 10:49:32 app-1           | 2025-01-10 09:49:32,243 CONFIG [com.goo.api.cli.htt.HttpTransport] (executor-thread-1) Total: 253 bytes2025-01-10 10:49:32 app-1           | 2025-01-10 09:49:32,243 CONFIG [com.goo.api.cli.htt.HttpTransport] (executor-thread-1) {2025-01-10 10:49:32 app-1           |   "error": {2025-01-10 10:49:32 app-1           |     "errors": [2025-01-10 10:49:32 app-1           |       {2025-01-10 10:49:32 app-1           |         "domain": "global",2025-01-10 10:49:32 app-1           |         "reason": "push.webhookUrlNotHttps",2025-01-10 10:49:32 app-1           |         "message": "WebHook callback must be HTTPS: "2025-01-10 10:49:32 app-1           |       }2025-01-10 10:49:32 app-1           |     ],2025-01-10 10:49:32 app-1           |     "code": 400,2025-01-10 10:49:32 app-1           |     "message": "WebHook callback must be HTTPS: "2025-01-10 10:49:32 app-1           |   }2025-01-10 10:49:32 app-1           | }2025-01-10 10:49:32 app-1           | 2025-01-10 09:49:32,248 DEBUG [org.jbo.res.rea.ser.cor.RuntimeExceptionMapper] (executor-thread-1) IOError processing HTTP request to https://example.com/optime/actions failed, the client likely terminated the connection.: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request2025-01-10 10:49:32 app-1           | POST https://www.googleapis.com/calendar/v3/calendars/primary/events/watch2025-01-10 10:49:32 app-1           | {2025-01-10 10:49:32 app-1           |   "code": 400,2025-01-10 10:49:32 app-1           |   "errors": [2025-01-10 10:49:32 app-1           |     {2025-01-10 10:49:32 app-1           |       "domain": "global",2025-01-10 10:49:32 app-1           |       "message": "WebHook callback must be HTTPS: ",2025-01-10 10:49:32 app-1           |       "reason": "push.webhookUrlNotHttps"2025-01-10 10:49:32 app-1           |     }2025-01-10 10:49:32 app-1           |   ],2025-01-10 10:49:32 app-1           |   "message": "WebHook callback must be HTTPS: "2025-01-10 10:49:32 app-1           | }

When building the Watch object, the URI I Use is HTTPS :

URI uri = new URI("https://example.com/optime/googlecalendar/notifications");        Calendar.Events.Watch watched = service.events().watch("primary",                new Channel()                        .setId("ChannelID")                        .setType("web_hook")                        .setResourceUri(uri.toURL().toString())        );

This URI has been declared in the Google console and is present in the credentials.json file with ID and secrets.

The domain does exist, has a valid, not self-signed certificate :

2025-01-10 10:48:07 app-1           | 2025-01-10 09:48:07,344 DEBUG [jdk.eve.security] (vert.x-internal-blocking-1) X509Certificate: Alg:SHA256withRSA, Serial:473c7bd72d57274b830aaf363f5417fd79c, Subject:CN=example.com, Issuer:CN=R10, O=Let's Encrypt, C=US, Key type:RSA, Length:2048, Cert Id:1053261847, Valid from:1/10/25, 8:48 AM, Valid until:4/10/25, 8:48 AM

An endpoint also exists in a controller :

@Path("/notifications")@POSTpublic Response watch(Object payload) {    LOG.debug("WATCH function");    return Response.ok().build();}

At this point, I can't understand what I'm missing and I hope someone is able to point the mistake(s) I've made.

Thanx for your time.


Viewing all articles
Browse latest Browse all 1499

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>