Closed congmingdexiong closed 5 years ago
Cloudant requires TLS 1.2 or higher so it sounds like your version of Java is too low.
As stated Cloudant requires TLSv1.2 or higher, the TLS versions available to java-cloudant are determined by the SSLSocketFactory
, if you have not customized that then it will be the default socket factory provided to https protocol connections by the Java runtime.
If your Java default socket factory is not providing TLSv1.2 to client https connections then you either need to configure it to do so or change to a different Java runtime.
Note that we are unable to provide support for configuring your runtime environment, but here is some information we've gathered on this topic previously that may be helpful to you:
For Java 8:
https.protocols=TLSv1.2
property and also
For Java 7:
jdk.tls.client.protocols
property1.7.0_131-b31
, prior to that the system property https.protocols=TLSv1.2
is required (optionally with other versions of TLS if needed)
The problem appears when code in linux server trying to touch cloudant db service located in IBM bluemix env, got below error: " Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.cloudant.client.org.lightcouch.CouchDbException: Error retrieving server response at https://xxxxxxxxxxxxxxxxxxxxx-bluemix.cloudant.com:443/server/_find.] with root cause
javax.net.ssl.SSLException: Received fatal alert: protocol_version "
Code worked fine on my local, issues only found in bluecloud server
Below is the code I used: " CloudantClient client =ClientBuilder.url(new URL(cloundantUrl)) .username(username) .password(password) .build();
"