Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8291888

module export issues with legacy provider registration

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 9
    • security-libs
    • None
    • 9
    • generic
    • generic

      the JCA framework still supports registration of security Providers via legacy mode which uses the classname/classpath approach.

      noticed that a few of the providers that ship in the JDK don't load correctly in this mode. Stumbled across this while working on JDK-8155246

      ProviderConfig: Error loading legacy provider sun.security.jgss.SunProvider
      java.security.PrivilegedActionException: java.lang.IllegalAccessException: class sun.security.jca.ProviderConfig$ProviderLoader$1 (in module java.base) cannot access class sun.security.jgss.SunProvider (in module java.security.jgss) because module java.security.jgss does not export sun.security.jgss to module java.base
              at java.base/java.security.AccessController.doPrivileged(AccessController.java:575)
              at java.base/sun.security.jca.ProviderConfig$ProviderLoader.legacyLoad(ProviderConfig.java:404)
              at java.base/sun.security.jca.ProviderConfig$ProviderLoader.load(ProviderConfig.java:369)
              at java.base/sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:254)
              at java.base/sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:248)
              at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
              at java.base/sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:248)
              at java.base/sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:226)
              at java.base/sun.security.jca.ProviderList.loadAll(ProviderList.java:319)
              at java.base/sun.security.jca.ProviderList.removeInvalid(ProviderList.java:336)
              at java.base/sun.security.jca.Providers.getFullProviderList(Providers.java:186)
              at java.base/java.security.Security.getProviders(Security.java:437)


      ===

      ProviderConfig: Loading legacy provider: com.sun.security.sasl.Provider
      ProviderConfig: Error loading legacy provider com.sun.security.sasl.Provider
      java.security.PrivilegedActionException: java.lang.IllegalAccessException: class sun.security.jca.ProviderConfig$ProviderLoader$1 (in module java.base) cannot access class com.sun.security.sasl.Provider (in module java.security.sasl) because module java.security.sasl does not export com.sun.security.sasl to module java.base
              at java.base/java.security.AccessController.doPrivileged(AccessController.java:575)
              at java.base/sun.security.jca.ProviderConfig$ProviderLoader.legacyLoad(ProviderConfig.java:404)
              at java.base/sun.security.jca.ProviderConfig$ProviderLoader.load(ProviderConfig.java:369)
              at java.base/sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:254)
              at java.base/sun.security.jca.ProviderConfig$3.run(ProviderConfig.java:248)

      ======

      copy of the java.security properties file that's used in such scenario:

      security.provider.1=sun.security.provider.Sun
      security.provider.2=sun.security.rsa.SunRsaSign
      security.provider.3=sun.security.ssl.SunJSSE
      security.provider.4=com.sun.crypto.provider.SunJCE
      security.provider.5=sun.security.jgss.SunProvider
      security.provider.6=com.sun.security.sasl.Provider

            coffeys Sean Coffey
            coffeys Sean Coffey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: