The error is caused by an incomplete certificate chain in the keystore. To resolve this error, do the following:
Access Google Calendar API in Firefox. Export the three certificates:
- GeoTrustGlobalCA
- GoogleInternetAuthorityG2
- *.google.com
then import all three into the JKS file.
keytool -importcert -alias GoogleInternetAuthorityG2 -keystore my.jks -file /Users/GoogleInternetAuthorityG2.pem
keytool -importcert -alias GeoTrustGlobalCA -keystore my.jks -file /Users/GeoTrustGlobalCA.pem
keytool -importcert -alias *.google.com -keystore my.jks -file /Users/\*.google.com.pem