error "javax.net.ssl.SSLException: Received fatal alert: protocol_version" starting RQM Command Line Adapter with Java 1.8
I recently worked with a client who was unable to start the RQM command line adapter after upgrading to java 1.8, specifically java version "1.8.0_51"
The RQM Command Line Adapter is 5.0.2 connecting to an RQM 5.0.2 repository.
The following error is thrown in the console and adapter.log:
10:04:43,697 [main] WARN com.ibm.rqm.adapter.commandline - Configuration file C:\Ddrive\RQM\Integration\RQM-Extras-CommandLineAdapter-5.0.2\adapters\RQMCommandLineAdapter\config.ini does not exist, adapter will use the arguments passed
10:04:43,942 [main] INFO com.ibm.rqm.adapter.library - Successfully created an HTTP client
10:04:44,533 [main] ERROR com.ibm.rqm.adapter.library - The adapter failed to connect to the server
javax.net.ssl.SSLException: Received fatal alert: protocol_version
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
at sun.security.ssl.AppOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:827)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.flushRequestOutputStream(MultiThreadedHttpConnectionManager.java:1525)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1975)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
at com.ibm.rqm.integration.client.clientlib.JFSHttpsClient.login(JFSHttpsClient.java:100)
at com.ibm.rqm.integration.client.clientlib.RQMConnectionHelper.login(RQMConnectionHelper.java:202)
at com.ibm.rqm.adapter.library.data.ServerInformation.login(ServerInformation.java:194)
at com.ibm.rqm.adapter.library.data.NewRequester.<init>(NewRequester.java:138)
at com.ibm.rqm.adapter.commandline.QMCommandLineAdapter.main(QMCommandLineAdapter.java:306)
10:04:45,099 [main] WARN com.ibm.rqm.adapter.library - Unable to determine RQM server version. This is expected for RQM 2.x and earlier servers.
10:04:46,096 [main] ERROR com.ibm.rqm.adapter.library - Error while retrieving the list of project areas
10:04:46,110 [main] ERROR com.ibm.rqm.adapter.commandline - "Failed to log in to server at https://myserver.com/qm . Please check the repository URL https://myserver.com/qm, user name xxxx and its password and try again. Make sure that the Server is available."
I am able to start the command line adapter using the exact java version (1.8) defined in my system PATH var, connecting to an RQM 5.0.2 server running the same java version, 1.7.
Is there a configuration file change for either java or the RQM command line adapter to resolve this problem?
Thanks,
Brett
The RQM Command Line Adapter is 5.0.2 connecting to an RQM 5.0.2 repository.
The following error is thrown in the console and adapter.log:
10:04:43,697 [main] WARN com.ibm.rqm.adapter.commandline - Configuration file C:\Ddrive\RQM\Integration\RQM-Extras-CommandLineAdapter-5.0.2\adapters\RQMCommandLineAdapter\config.ini does not exist, adapter will use the arguments passed
10:04:43,942 [main] INFO com.ibm.rqm.adapter.library - Successfully created an HTTP client
10:04:44,533 [main] ERROR com.ibm.rqm.adapter.library - The adapter failed to connect to the server
javax.net.ssl.SSLException: Received fatal alert: protocol_version
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
at sun.security.ssl.AppOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:827)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.flushRequestOutputStream(MultiThreadedHttpConnectionManager.java:1525)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1975)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
at com.ibm.rqm.integration.client.clientlib.JFSHttpsClient.login(JFSHttpsClient.java:100)
at com.ibm.rqm.integration.client.clientlib.RQMConnectionHelper.login(RQMConnectionHelper.java:202)
at com.ibm.rqm.adapter.library.data.ServerInformation.login(ServerInformation.java:194)
at com.ibm.rqm.adapter.library.data.NewRequester.<init>(NewRequester.java:138)
at com.ibm.rqm.adapter.commandline.QMCommandLineAdapter.main(QMCommandLineAdapter.java:306)
10:04:45,099 [main] WARN com.ibm.rqm.adapter.library - Unable to determine RQM server version. This is expected for RQM 2.x and earlier servers.
10:04:46,096 [main] ERROR com.ibm.rqm.adapter.library - Error while retrieving the list of project areas
10:04:46,110 [main] ERROR com.ibm.rqm.adapter.commandline - "Failed to log in to server at https://myserver.com/qm . Please check the repository URL https://myserver.com/qm, user name xxxx and its password and try again. Make sure that the Server is available."
I am able to start the command line adapter using the exact java version (1.8) defined in my system PATH var, connecting to an RQM 5.0.2 server running the same java version, 1.7.
Is there a configuration file change for either java or the RQM command line adapter to resolve this problem?
Thanks,
Brett
One answer
In this case, the the load balancer network hardware did not support TLS 1.1 nor 1.2. Java made TLS 1.2 the default SSL protocol starting with Java 8, it was TLSv1 in Java 7.
The solution was to modify the start.bat for the RQM Command Line Adapter to add these arguments in bold (this is a snippet from start.bat):
java -version
java.exe -Dlog4j.configuration=file:.\log4j.properties -Dhttps.protocols=TLSv1 -Djdk.tls.client.protocols=TLSv1 -classpath "%filecontent%" com.ibm.rqm.adapter.commandline.QMCommandLineAdapter %*
if Errorlevel 1 goto ERROR_MESSAGE
if Errorlevel 2 goto ERROR_MESSAGE
GOTO END_BATCH
Make a copy of the existing start.bat in the adapter directory, e.g. C:\Adapters\RQM-Extras-CommandLineAdapter-5.0.2\adapters\RQMCommandLineAdapter then edit start.bat to add the arguments above.
Thanks,
Brett
The solution was to modify the start.bat for the RQM Command Line Adapter to add these arguments in bold (this is a snippet from start.bat):
java -version
java.exe -Dlog4j.configuration=file:.\log4j.properties -Dhttps.protocols=TLSv1 -Djdk.tls.client.protocols=TLSv1 -classpath "%filecontent%" com.ibm.rqm.adapter.commandline.QMCommandLineAdapter %*
if Errorlevel 1 goto ERROR_MESSAGE
if Errorlevel 2 goto ERROR_MESSAGE
GOTO END_BATCH
Make a copy of the existing start.bat in the adapter directory, e.g. C:\Adapters\RQM-Extras-CommandLineAdapter-5.0.2\adapters\RQMCommandLineAdapter then edit start.bat to add the arguments above.
Thanks,
Brett