I'm trying to access Google Maps from my Java code as follows:
GeoApiContext context = new GeoApiContext.Builder().apiKey("API_KEY_HERE").build();
//Setting variables...
DistanceMatrix matrix = DistanceMatrixApi.newRequest(context).origins(origins).destinations(destinations).await();
Calling await() throws an exception:
java.net.UnknownServiceException: Unable to find acceptable protocols. isFallback=false, modes=[ConnectionSpec(cipherSuites=[TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_CHACHA20_POLY1305_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA], tlsVersions=[TLS_1_3, TLS_1_2], supportsTlsExtensions=true), ConnectionSpec()], supported protocols=[TLSv1]
I gather this is coming from the OkHttp library used by Google Maps and that it has something to do with the TLS version, but I have no idea what to do to address it. All of the test cases in the source code use a mock web server and there are no examples of specifying a real server, leading me to believe that it was done under the hood.
Does anyone have example code for using the Google Maps Java API with a real web server?