RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1008456 - java.security.ProviderException: Could not initialize NSS on EWS2
Summary: java.security.ProviderException: Could not initialize NSS on EWS2
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: nss
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Elio Maldonado Batiz
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 1022950
TreeView+ depends on / blocked
 
Reported: 2013-09-16 11:44 UTC by Michal Haško
Modified: 2015-03-02 04:01 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1022950 (view as bug list)
Environment:
Last Closed: 2013-09-17 08:44:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Michal Haško 2013-09-16 11:44:35 UTC
Description of problem:
When trying to configure SSL support for tomcat7 from EWS2, the following error was encountered:


Version-Release number of selected component (if applicable):
Tomcat7 from EWS-2.0.1 GA


How reproducible:
100%


Steps to Reproduce:
1. make sure JDK7 is used (java -version)
2. generate the java keystore file:
   # /usr/lib/jvm/java/bin/keytool -genkey -alias tomcat -keyalg RSA \
     -keystore /root/keystore.jks
3. add ssl connector to tomcat7/conf/server.xml:
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               SSLEnabled="true" maxThreads="150" scheme="https" secure="true"
               keystoreFile="/root/keystore.jks" keystorePass="tomcat"
               clientAuth="false" sslProtocol="TLS" />
4. start tomcat:
   # tomcat7/bin/startup.sh


Actual results:
The following exception is observed in catalina.out:
Sep 16, 2013 7:26:09 AM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.0-fips 29 Mar 2010)
java.security.ProviderException: Could not initialize NSS
	at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:223)
	at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:103)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:224)
	at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:206)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:206)
	at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:187)
	at sun.security.jca.ProviderList.loadAll(ProviderList.java:281)
	at sun.security.jca.ProviderList.removeInvalid(ProviderList.java:298)
	at sun.security.jca.Providers.getFullProviderList(Providers.java:176)
	at java.security.Security.getProviders(Security.java:458)
	at org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:382)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:99)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:633)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:658)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: java.io.IOException: NSS initialization failed
	at sun.security.pkcs11.Secmod.initialize(Secmod.java:223)
	at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:218)
	... 27 more


Expected results:
curl -k https://localhost:8443/ should return a tomcat welcome page


Additional info:
This is *only* reproducible on Tomcat7 *and* JDK7 (no Tomcat6 or JDK6)

Comment 2 Michal Haško 2013-09-16 14:53:21 UTC
OK, the errors produced in catalina.out was probably caused by OpenJDK1.7. I managed to get the org.apache.coyote.http11.Http11NioProtocol connector working with OracleJDK1.7.

But there is still something fishy going on with tomcat/ssl:

# wget -O - https://localhost:8443/
--2013-09-16 10:52:44--  https://localhost:8443/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:8443... connected.
OpenSSL: error:100AE081:elliptic curve routines:EC_GROUP_new_by_curve_name:unknown group
OpenSSL: error:1408D010:SSL routines:SSL3_GET_KEY_EXCHANGE:EC lib
Unable to establish SSL connection.

Comment 3 Elio Maldonado Batiz 2013-09-16 15:15:53 UTC
What were the versions of nss, nss-softokn, nss-util installed?

Comment 4 Jean-frederic Clere 2013-09-17 07:52:05 UTC
That looks like a configuration error protocol="org.apache.coyote.http11.Http11NioProtocol" doesn't need native so you need to comment out the:
<Listener className="org.apache.catalina.core.AprLifecycleListener"/>
is you are not using native for another connector you need to configure the listener correctly.

Comment 5 Jean-frederic Clere 2013-09-17 08:09:01 UTC
the wget error looks like a problem in the box doing the wget, could you try with a browser and/or from another box?

Comment 6 Michal Haško 2013-09-17 08:44:49 UTC
As Jean-Frédéric pointed out, this is not a problem with the tomcat. Wget from a different box works just fine.

I am closing this bug for the sake of the original issue.


Note You need to log in before you can comment on or make changes to this bug.