What to do if you get a javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake in the IBM JDK

Background

When trying to access an external HTTPS site with an application that uses the IBM JDK, such as WebSphere Liberty, the following message may appear depending on the site.

R javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
R  at com.ibm.jsse2.av.a(av.java:599)
R  at com.ibm.jsse2.av.i(av.java:869)
R  at com.ibm.jsse2.av.a(av.java:19)
R  at com.ibm.jsse2.av.startHandshake(av.java:672)
R  at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396)
R  at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
R  at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:14

On the other hand, the Oracle JDK may work.

Cause

The IBM JDK negotiates communication with TLSv1.0 by default. On the other hand, if the other party is set to only allow TLSv1.2 (mostly these days), negotiation will fail and the above error message will occur.

Correspondence

Set the following three system properties. Then it will be negotiated with TLSv1.2. This option has been confirmed with JDK 1.8.

jvm.options etc.


-Dcom.ibm.jsse2.overrideDefaultTLS=true
-Djdk.tls.client.protocols=TLSv1.2
-Dhttps.protocols=TLSv1.2

Recommended Posts

What to do if you get a javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake in the IBM JDK
What to do if you get a java.io.IOException in GlassFish
What to do if you get a gcc error in Docker
What to do if you get a DISPLAY error in gym.render ()
What to do if you get a groovy warning in Thymeleaf Layout
What to do if you get a wrong number of arguments error in binding.pry
What to do if you can't get the text of an element in Selenium
What to do if you get a "302" error in your controller unit test code in Rails
What to do if you get an error in Basic authentication during Rails test code
What to do if you forget the root password in CentOS7
[Maven] What to do if you are asked to incorporate a jar that is not in the remote repository into the war
What to do if you select a JRE in Eclipse and get "The selected JRE does not support the current compliance level 11"
What to do if you get a "Mysql2 :: Error: Operand should contain 1 column (s)" error in Rails
What to do if you get a JNI shared library error when trying to build in Eclipse
What to do if you get an error during rails db: reset
What to do if you get a MiniMagick vulnerability alert on GitHub
What to do if Operation not permitted is displayed when you execute a command in the terminal
What to do if you get a SQLite3 :: BusyException: database is locked error
What to do if you get the error message unrecognized selector send to instance "***"
What to do if you get To install the missing version, run `gem install bundler: 2.1.4`
What to do if you get an "A server is already running." Error when you try to start the rails server
What to do if you accidentally create a model
What to do if you get Could not save master table to file after importing a project in Eclipse
What to do if you get a NoClassDefFoundError when trying to run eclipse on Java9
What to do if you get the error Couldn't find Item without an ID
What to do if you get a port error when docker-compose up on Mac
[Solution] What to do if you get a Docker error'ERROR: Cannot connect to the Docker daemon at unix: ///var/run/docker.sock. Is the docker daemon running?'
What to do if you get the warning "Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1." in Rails 6.0
What to do if you can't find the JDK you put in SDKMAN after migrating from bash to zsh on macOS
What to do if you can't use the rails command
What to do if you don't see the test code error message in the terminal console
[Rails] What to do if you accidentally install bundle in the production environment in your local environment
[Rails Tutorial Chapter 2] What to do when you make a mistake in the column name
What to do if you get a "Cannot Pull Container Error" when starting ECS ​​Fargate
[Rails] What to do if you can't get an error message with the errors method
What you need to do to open a file from the menu in the document-Based App macOS app
How to make a jar with old Hadoop (hadoop-core-0.20.2-cdh3u6) in Gradle: (What to do if you get Could not expand ZIP ..)
What to do if the Rails page doesn't appear in Rails tutorial 1.3.2
What to do if Cloud9 is full in the Rails tutorial
What to do if you get angry with OpenSSL with pyenv install
What to do when you become a Problem During Content Assist
What to do if you cannot roll back the migration (UnknownMigrationVersionError)
[Rails] What to do if you can't get parameters with form_with
What to do if you get an [An HTTP request took too long to complete.] Error in Docker.
What to do if the prefix c is not bound in JSP
What to do if you get an error with bundle install by entering gem'bcrypt' in your Gemfile
What to do if you get an uninitialized constant Likes Controller error
What to do if you can't install the plugin from the Eclipse marketplace
What to do if the image posted by refile disappears after setting a 404 error page in Rails
What to do if you don't like the code generated by swagger-codegen-cli
What to do if you can't bundle update and bundle install after installing Ruby 3.0.0 in the Rails tutorial
What to do if you get an error when you hit Heroku logs
What to do if you install Ubuntu
What to do if you get the error Too long with no output (exceeded 10m0s) on CircleCI
[Rails] What to do if you get an error saying "Could not find a JavaScript runtime." When executing the rails s command on Catalina
What to do if you have enabled Use the WSL2 based engine in Docker Desktop with insufficient WSL2 installation
How to translate the error message into Japanese (What to do if you cannot log in for some reason)
What to do if you get Could not locate Gemfile or .bundle / directory
What to do if you can't activate the select box created by bootstrap-select
What to do if the changes are not reflected in the jar manifest file
What to do if you get an error on heroku rake db: migrate