Uploaded image for project: 'ENTSBT'
  1. ENTSBT
  2. ENTSBT-178

javax.net.ssl.SSLHandshakeException when connecting between RHEL8 OpenJDK image and RHEL7 MySQL 5.7 image

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.1.6.CR4
    • None
    • None
    • None

      I have DB application deployed on OpenJDK RHEL8 image and trying to connect to MySQL 5.7 RHEL7 image. Connection is failing repeatedly.
      I am using openjdk/openjdk-11-rhel8:latest and rhscl/mysql-57-rhel7:5.7. MySQL jdbc driver <version.mysql.mysql-connector-java>8.0.16</version.mysql.mysql-connector-java>.

      /usr/local/s2i/run: line 15: /opt/jboss/container/maven/default//scl-enable-maven: No such file or directory
      Starting the Java application using /opt/jboss/container/java/run/run-java.sh ...
      INFO exec  java -javaagent:/opt/jboss/container/jolokia/jolokia.jar=config=/opt/jboss/container/jolokia/etc/jolokia.properties -XX:+UseParallelOldGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MaxMetaspaceSize=100m -XX:+ExitOnOutOfMemoryError -cp "." -jar /deployments/springboot-sqldb-jdbc-rest-2.0.0-SNAPSHOT.jar  
      WARNING: An illegal reflective access operation has occurred
      WARNING: Illegal reflective access by org.jolokia.util.ClassUtil (file:/opt/jboss/container/jolokia/jolokia-jvm-1.6.2.redhat-00002-agent.jar) to constructor sun.security.x509.X500Name(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)
      WARNING: Please consider reporting this to the maintainers of org.jolokia.util.ClassUtil
      WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
      WARNING: All illegal access operations will be denied in a future release
      I> No access restrictor found, access to any MBean is allowed
      Jolokia: Agent started with URL https://10.129.0.202:8778/jolokia/ 
      2019-09-19 08:59:16.179  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$af4bba73] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      
        .   ____          _            __ _ _
       /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
      ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
       \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
        '  |____| .__|_| |_|_| |_\__, | / / / /
       =========|_|==============|___/=/_/_/_/
       :: Spring Boot ::        (v2.1.6.RELEASE)
      
      2019-09-19 08:59:16.463  INFO 1 --- [           main] b.c.PropertySourceBootstrapConfiguration : Located property source: CompositePropertySource {name='composite-configmap', propertySources=[ConfigMapPropertySource {name='configmap.db-config-map.sb2-openjdk11rhel8'}]}
      2019-09-19 08:59:16.465  INFO 1 --- [           main] b.c.PropertySourceBootstrapConfiguration : Located property source: SecretsPropertySource {name='secrets.springboot-sqldb-jdbc-rest.sb2-openjdk11rhel8'}
      2019-09-19 08:59:16.606  INFO 1 --- [           main] c.redhat.xpass.database.RestApplication  : The following profiles are active: kubernetes
      2019-09-19 08:59:17.399  INFO 1 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=513c75d6-3119-3d6e-9f6e-a4c22731f820
      2019-09-19 08:59:17.448  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$af4bba73] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      2019-09-19 08:59:17.458  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$9331b776] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      2019-09-19 08:59:17.866  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
      2019-09-19 08:59:17.895  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
      2019-09-19 08:59:17.895  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/9.0.7.redhat-16
      2019-09-19 08:59:17.992  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
      2019-09-19 08:59:17.992  INFO 1 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1373 ms
      2019-09-19 08:59:18.346  INFO 1 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
      2019-09-19 08:59:18.685  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
      2019-09-19 08:59:18.688  INFO 1 --- [           main] c.redhat.xpass.database.RestApplication  : Started RestApplication in 4.767 seconds (JVM running for 5.662)
      2019-09-19 08:59:18.805  INFO 1 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
      2019-09-19 08:59:18.806  INFO 1 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
      2019-09-19 08:59:18.816  INFO 1 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 10 ms
      2019-09-19 08:59:18.952 DEBUG 1 --- [nio-8080-exec-5] o.a.tomcat.jdbc.pool.PooledConnection    : Instantiating driver using class: com.mysql.jdbc.Driver [url=jdbc:mysql://testdb-mysql:3306/testdb]
      2019-09-19 08:59:18.953 DEBUG 1 --- [nio-8080-exec-5] o.a.tomcat.jdbc.pool.ClassLoaderUtil     : Attempting to load class[com.mysql.jdbc.Driver] from org.springframework.boot.loader.LaunchedURLClassLoader@63e31ee
      Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
      2019-09-19 08:59:19.134 DEBUG 1 --- [nio-8080-exec-5] o.a.tomcat.jdbc.pool.PooledConnection    : Unable to connect to database.
      
      com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
      
      The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
      	at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)
      	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)
      	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835)
      	at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)
      	at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)
      	at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
      	at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:319)
      	at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:212)
      	at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:739)
      	at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:671)
      	at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:483)
      	at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:154)
      	at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:118)
      	at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:107)
      	at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:131)
      	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:157)
      	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
      	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
      	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:370)
      	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:417)
      	at com.redhat.xpass.database.service.sql.SqlDbController.initDatabase(SqlDbController.java:146)
      	at com.redhat.xpass.database.service.sql.SqlDbController.selectall(SqlDbController.java:102)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
      	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
      	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
      	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
      	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
      	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)
      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
      	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
      	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:414)
      	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1379)
      	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
      
      The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
      	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
      	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
      	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
      	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
      	at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)
      	at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection(NativeProtocol.java:361)
      	at com.mysql.cj.protocol.a.NativeAuthenticationProvider.negotiateSSLConnection(NativeAuthenticationProvider.java:777)
      	at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:486)
      	at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:202)
      	at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1452)
      	at com.mysql.cj.NativeSession.connect(NativeSession.java:165)
      	at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:955)
      	at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)
      	... 73 common frames omitted
      Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
      	at java.base/sun.security.ssl.HandshakeContext.<init>(HandshakeContext.java:169)
      	at java.base/sun.security.ssl.ClientHandshakeContext.<init>(ClientHandshakeContext.java:98)
      	at java.base/sun.security.ssl.TransportContext.kickstart(TransportContext.java:216)
      	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:395)
      	at com.mysql.cj.protocol.ExportControlled.performTlsHandshake(ExportControlled.java:316)
      	at com.mysql.cj.protocol.StandardSocketFactory.performTlsHandshake(StandardSocketFactory.java:188)
      	at com.mysql.cj.protocol.a.NativeSocketConnection.performTlsHandshake(NativeSocketConnection.java:99)
      	at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection(NativeProtocol.java:352)
      	... 80 common frames omitted
      
      

              ssitani Stefan Sitani (Inactive)
              lfuka Libor Fuka
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: