1 Reply Latest reply: Oct 24, 2012 4:28 AM by EJP RSS

    Configure SSL on Tomcat 6.0.24

    970361
      Hi

      I have followed below steps to setup SSL

      C:\Program Files\Java\jdk1.6.0_30\bin>keytool -genkey -alias tomcat -keyalg RSA


      Provided below details

      Enter keystore password:
      Re-enter new password:
      What is your first and last name?
      [Unknown]:
      What is the name of your organizational unit?
      [Unknown]:
      What is the name of your organization?
      [Unknown]:
      What is the name of your City or Locality?
      [Unknown]:
      What is the two-letter country code for this unit?
      [Unknown]:
      What is the name of your State or Province?
      [Unknown]:
      Enter key password for <tomcat>
      (RETURN if same as keystore password):


      copied the generated keystore file to C:\apache-tomcat-6.0.24-windows-x64\key\


      uncommented the below statement and appended to include keystore password and keystore file

      <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
      maxThreads="150" scheme="https" secure="true"
      clientAuth="false" sslProtocol="TLS" keystorePass="changeit" keystoreFile="C:\apache-tomcat-6.0.24-windows-x64\key\.keystore" />


      I have got the below error message when I restart the Tomcat server

      Could anyone help me on this ?



      Error Message

      24-Oct-2012 10:20:01 org.apache.catalina.core.AprLifecycleListener init
      INFO: Loaded APR based Apache Tomcat Native library 1.1.19.
      24-Oct-2012 10:20:01 org.apache.catalina.core.AprLifecycleListener init
      INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], ra
      ndom [true].
      24-Oct-2012 10:20:01 org.apache.catalina.startup.SetAllPropertiesRule begin
      WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'clie
      ntAuth' to 'false' did not find a matching property.
      24-Oct-2012 10:20:01 org.apache.catalina.startup.SetAllPropertiesRule begin
      WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'keys
      torePass' to 'changeit' did not find a matching property.
      24-Oct-2012 10:20:01 org.apache.catalina.startup.SetAllPropertiesRule begin
      WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'keys
      toreFile' to 'C:\apache-tomcat-6.0.24-windows-x64\key\.keystore' did not find a
      matching property.
      24-Oct-2012 10:20:02 org.apache.coyote.http11.Http11AprProtocol init
      INFO: Initializing Coyote HTTP/1.1 on http-8080
      24-Oct-2012 10:20:02 org.apache.coyote.http11.Http11AprProtocol init
      SEVERE: Error initializing endpoint
      java.lang.Exception: No Certificate file specified or invalid file format
      at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method)
      at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:720)
      at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.jav
      a:107)
      at org.apache.catalina.connector.Connector.initialize(Connector.java:100
      7)
      at org.apache.catalina.core.StandardService.initialize(StandardService.j
      ava:677)
      at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
      a:795)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:540)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:560)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      24-Oct-2012 10:20:02 org.apache.catalina.startup.Catalina load
      SEVERE: Catalina.start
      LifecycleException: Protocol handler initialization failed: java.lang.Exception
      : No Certificate file specified or invalid file format
      at org.apache.catalina.connector.Connector.initialize(Connector.java:100
      9)
      at org.apache.catalina.core.StandardService.initialize(StandardService.j
      ava:677)
      at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
      a:795)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:540)
      at org.apache.catalina.startup.Catalina.load(Catalina.java:560)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      24-Oct-2012 10:20:02 org.apache.catalina.startup.Catalina load
      INFO: Initialization processed in 1851 ms
      24-Oct-2012 10:20:02 org.apache.catalina.core.StandardService start
      INFO: Starting service Catalina
      24-Oct-2012 10:20:02 org.apache.catalina.core.StandardEngine start
      INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
      24-Oct-2012 10:20:02 org.apache.catalina.startup.HostConfig deployDescriptor
      INFO: Deploying configuration descriptor host-manager.xml
      24-Oct-2012 10:20:03 org.apache.catalina.startup.HostConfig deployDescriptor
      INFO: Deploying configuration descriptor manager.xml
      24-Oct-2012 10:20:03 org.apache.catalina.startup.HostConfig deployDirectory
      INFO: Deploying web application directory docs
      24-Oct-2012 10:20:03 org.apache.catalina.startup.HostConfig deployDirectory
      INFO: Deploying web application directory examples
      24-Oct-2012 10:20:04 org.apache.catalina.startup.HostConfig deployDirectory
      INFO: Deploying web application directory ROOT
      24-Oct-2012 10:20:04 org.apache.coyote.http11.Http11AprProtocol start
      INFO: Starting Coyote HTTP/1.1 on http-8080
      24-Oct-2012 10:20:04 org.apache.coyote.http11.Http11AprProtocol start
      SEVERE: Error starting endpoint
      java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket
      address (protocol/network address/port) is normally permitted.
      at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:646)
      at org.apache.tomcat.util.net.AprEndpoint.start(AprEndpoint.java:753)
      at org.apache.coyote.http11.Http11AprProtocol.start(Http11AprProtocol.ja
      va:137)
      at org.apache.catalina.connector.Connector.start(Connector.java:1080)
      at org.apache.catalina.core.StandardService.start(StandardService.java:5
      31)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710
      )
      at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      24-Oct-2012 10:20:04 org.apache.catalina.startup.Catalina start
      SEVERE: Catalina.start:
      LifecycleException: service.getName(): "Catalina"; Protocol handler start fail
      ed: java.lang.Exception: Socket bind failed: [730048] Only one usage of each soc
      ket address (protocol/network address/port) is normally permitted.
      at org.apache.catalina.connector.Connector.start(Connector.java:1087)
      at org.apache.catalina.core.StandardService.start(StandardService.java:5
      31)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710
      )
      at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      24-Oct-2012 10:20:04 org.apache.catalina.startup.Catalina start
      INFO: Server startup in 1633 ms

      Thank you