Not able to connect to Googe Cloud Spanner with Java code Getting SSLException error.
Written a code in java which tries to connect to Google Spanner I have already created the Spanner instance and also the database along with a table.
However when I try to run the Java code it gives error of getting error com.google.cloud.spanner.SpannerException: UNKNOWN: javax.net.ssl.SSLException: unable to setup trustmanager
try (InputStream credentialsStream = new FileInputStream(credentialsFile)){
credentials = GoogleCredentials.fromStream(new FileInputStream(credentialsFile));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
SpannerOptions options = SpannerOptions.newBuilder().setProjectId("coral-velocity-252502").build();
Spanner spanner = options.getService();