title: How to make tomcat FIPS Mode enabling
body: <p>i have added this in server.xml to enable tomcat FIPSMode</p>
  
  <pre><code> &lt;Listener className="org.apache.catalina.core.AprLifecycleListener"
   SSLEngine="on" FIPSMode="on" /&gt;
  </code></pre>
  
  <p>But after that logs are throwing,</p>
  
  <pre><code>Dec 01, 2015 3:28:53 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
  SEVERE: Failed to enter FIPS mode
  java.lang.Error: Failed to enter FIPS mode
      at org.apache.catalina.core.AprLifecycleListener.lifecycleEvent(AprLifecycleListener.java:147)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
      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:638)
  </code></pre>
  
  <p>when i check the <a href="https://tomcat.apache.org/tomcat-7.0-doc/config/listeners.html#APR_Lifecycle_Listener_-_org.apache.catalina.core.AprLifecycleListener" rel="nofollow">tomcat 7 docs for FIPSMode</a></p>
  
  <p>it is asking us to create OpenSSL library </p>
  
  <pre><code>FIPS mode requires you to have a FIPS-capable OpenSSL library which you must build yourself. If this attribute is set to any of the above values, the SSLEngine must be enabled as well.
  </code></pre>
  
  <p>So, now the question is how to create OpenSSL library for tomcat FIPS ? and how to integrate it with tomcat ?</p>
  
  <p>please share the steps or documentation to achieve this </p>
  
  <p>Please check this new exception #1</p>
  
  <pre><code>Dec 03, 2015 1:46:37 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
  INFO: Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.2.
  Dec 03, 2015 1:46:37 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
  INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
  Dec 03, 2015 1:46:37 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
  INFO: Initializing FIPS mode...
  Dec 03, 2015 1:46:37 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
  SEVERE: Failed to initialize the SSLEngine.
  java.lang.Exception: error:2D06C06E:FIPS routines:FIPS_mode_set:fingerprint does not match
      at org.apache.tomcat.jni.SSL.fipsModeSet(Native Method)
      at org.apache.catalina.core.AprLifecycleListener.initializeSSL(AprLifecycleListener.java:333)
      at org.apache.catalina.core.AprLifecycleListener.lifecycleEvent(AprLifecycleListener.java:138)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
      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:638)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
  
  Dec 03, 2015 1:46:37 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
  SEVERE: Failed to enter FIPS mode
  java.lang.Error: Failed to enter FIPS mode
      at org.apache.catalina.core.AprLifecycleListener.lifecycleEvent(AprLifecycleListener.java:147)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
      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:638)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
  
  java.lang.Error: Failed to enter FIPS mode
      at org.apache.catalina.core.AprLifecycleListener.lifecycleEvent(AprLifecycleListener.java:147)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
      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:638)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
  </code></pre>
  
  <p>openssl version </p>
  
  <pre><code>OpenSSL 1.0.1p-fips 9 Jul 2015
  </code></pre>
  
  <p><strong>Please check the new exception#2</strong></p>
  
  <pre><code>03-Dec-2015 22:46:24.577 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.29
  03-Dec-2015 22:46:24.578 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Nov 20 2015 09:18:00 UTC
  03-Dec-2015 22:46:24.578 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.29.0
  03-Dec-2015 22:46:24.579 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
  03-Dec-2015 22:46:24.579 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            2.6.32-131.0.15.el6.x86_64
  03-Dec-2015 22:46:24.584 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
  03-Dec-2015 22:46:24.585 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /java/jdk1.7.0_80/jre
  03-Dec-2015 22:46:24.585 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.7.0_80-b15
  03-Dec-2015 22:46:24.586 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
  03-Dec-2015 22:46:24.586 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /tomcat/apache-tomcat-8.0.29
  03-Dec-2015 22:46:24.587 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /tomcat/apache-tomcat-8.0.29
  03-Dec-2015 22:46:24.587 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/tomcat/apache-tomcat-8.0.29/conf/logging.properties
  03-Dec-2015 22:46:24.588 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
  03-Dec-2015 22:46:24.588 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/tomcat/apache-tomcat-8.0.29/endorsed
  03-Dec-2015 22:46:24.589 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/tomcat/apache-tomcat-8.0.29
  03-Dec-2015 22:46:24.590 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/tomcat/apache-tomcat-8.0.29
  03-Dec-2015 22:46:24.590 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/tomcat/apache-tomcat-8.0.29/temp
  03-Dec-2015 22:46:24.590 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.2.
  03-Dec-2015 22:46:24.591 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
  03-Dec-2015 22:46:24.657 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL Initializing FIPS mode...
  03-Dec-2015 22:46:24.691 SEVERE [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Failed to initialize the SSLEngine.
   java.lang.Exception: error:2D06C06E:FIPS routines:FIPS_mode_set:fingerprint does not match
      at org.apache.tomcat.jni.SSL.fipsModeSet(Native Method)
      at org.apache.catalina.core.AprLifecycleListener.initializeSSL(AprLifecycleListener.java:329)
      at org.apache.catalina.core.AprLifecycleListener.lifecycleEvent(AprLifecycleListener.java:135)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
  </code></pre>
  
  <p><strong>Finaly Worked!!</strong></p>
  
  <pre><code>04-Dec-2015 00:45:30.500 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.2.
  04-Dec-2015 00:45:30.500 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
  04-Dec-2015 00:45:30.561 INFO [main] **org.apache.catalina.core.AprLifecycleListener.initializeSSL Initializing FIPS mode...
  04-Dec-2015 00:45:30.576 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL Successfully entered FIPS mode**
  04-Dec-2015 00:45:30.577 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.1p 9 Jul 2015)
  04-Dec-2015 00:45:30.935 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-apr-8080"]
  04-Dec-2015 00:45:30.973 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-apr-8009"]
  04-Dec-2015 00:45:30.976 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 2308 ms
  </code></pre>