Connect to a cloud influxdb server with https


I would like to connect to an influxdb server which is in the cloud with a https method.
If I replace the getConnection() method with this below

OkHttpClient.Builder okHttpClientBuilder = new OkHttpClient().newBuilder() //
					.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS) //
					.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS) //
					.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS);
			InfluxDB influxDB = InfluxDBFactory.connect( this.url, this.username,
					this.password, okHttpClientBuilder);

I can get a http connection by giving the full url as config parameter, but i’m stuck when using https. I have the following error:

 InfluxDB-Exception: PKIX path building failed: unable to find valid certification path to requested target

any idea?

Hello Siden,

This is a problem with Java not being able to validate the SSL certificate. It might be required to install the root certificate on your operating system and/or add the certificate path as a command line argument.

Does this help somehow?