java.lang.NoClassDefFoundError: sun/security/ssl/SSLSocketImpl

Sonatype JIRA | Martin Kutter | 2 months ago
  1. 0

    Description The fix for [NEXUS-6838] introduced a hard dependency on sun.security.ssl.SSLSocketImpl. JREs with alternative JSSE implementations like the IBM JRE do not ship this class. This dependency leads to a NoClassDefFoundError on attempts to configure a proxy repository with a HTTPS URL, and thus renders the proxy repository feature unusable for https URLs. Symptoms # Browsing remote for proxy repositories with https remote does not work # Logfile shows {noformat} SEVERE: Unhandled exception or error intercepted java.lang.NoClassDefFoundError: sun/security/ssl/SSLSocketImpl at org.sonatype.nexus.apachehttpclient.NexusSSLConnectionSocketFactory.connectSocket(NexusSSLConnectionSocketFactory.java:114) at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195) {noformat} Steps to reproduce: # download and install IBM JRE # start nexus 2.x with IBM JRE # configure a proxy repository with a https remote # navigate to "browse remote" and try to browse the content Suggested fix Use the plattform independent way to set the host for SNI as documented by Oracle: https://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide.html#SNIExamples Quick fix Remove dependency on Oracle JRE by using reflection to access SSLSocketImpl. The quick fix makes https usable for non-Oracle JREs, but removes SNI support for these JREs.

    Sonatype JIRA | 2 months ago | Martin Kutter
    java.lang.NoClassDefFoundError: sun/security/ssl/SSLSocketImpl
  2. 0

    1.2.2 vs 1.3 - what does https support mean to you?

    Oracle Community | 2 decades ago | 843802
    java.lang.NoClassDefFoundError: sun/security/ssl/SSLSocketImpl
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    dW:Java:Java security:NoClassDefFoundError: sun/security/provider/Sun - Java security Forum

    ibm.com | 1 year ago
    java.lang.NoClassDefFoundError: sun/security/provider/Sun

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoClassDefFoundError

      sun/security/ssl/SSLSocketImpl

      at org.sonatype.nexus.apachehttpclient.NexusSSLConnectionSocketFactory.connectSocket()
    2. ${project.groupId}:${project.artifactId}
      NexusSSLConnectionSocketFactory.connectSocket
      1. org.sonatype.nexus.apachehttpclient.NexusSSLConnectionSocketFactory.connectSocket(NexusSSLConnectionSocketFactory.java:114)
      1 frame
    3. Apache HttpClient
      ProtocolExec.execute
      1. org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123)
      2. org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
      3. org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
      4. org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
      5. org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
      5 frames