0

I have installed the Apache Tomcat/7.0.76 on centos7. I want to enable SSL on the tomcat. I have root, intermediate, domain certificate. Like this

85163c004aa3625d.crt
gd_bundle-g2-g1.crt
gdig2.crt.pem
root.crt
private.key

then I ran following commands,
keytool -import root -keystore testing.jks -trustcacerts -file tomcat/root.crt

keytool -import -keystore testing.jks -trustcacerts -file tomcat/gd_bundle-g2-g1.crt

keytool -import -keystore testing.jks -trustcacerts -file tomcat/85163c004aa3625d.crt

Then I edited the server.xml as

<\Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" connectionTimeout="20000" redirectPort="8443" SSLEnabled="true" scheme="https" secure="true" sslProtocol="TLS" keystoreFile="/opt/tomcat/testingibay.jks" keystorePass="tomcat" \>

But then I saved that file and restarted tomcat service, https://test.testing.local:8443 is not loading and however I can load the http://test.testing.local:8080

When I ran ./configtest.sh it gives Using CATALINA_BASE: /opt/tomcat Using CATALINA_HOME: /opt/tomcat Using CATALINA_TMPDIR: /opt/tomcat/temp Using JRE_HOME: /usr Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar Jan 29, 2019 10:52:29 PM org.apache.coyote.http11.Http11Protocol WARNING: The HTTP BIO connector has been removed in Tomcat 8.5.x onwards. The HTTP BIO connector configuration has been automatically switched to use the HTTP NIO connector instead. Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server version: Apache Tomcat/8.5.37 Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server built: Dec 12 2018 12:07:02 UTC Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server number: 8.5.37.0 Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Name: Linux Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Version: 3.10.0-957.1.3.el7.x86_64 Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Architecture: amd64 Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Java Home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.201-2.6.16.1.el7_6.x86_64/jre Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Version: 1.7.0_201-mockbuild_2018_11_19_16_10-b00 Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Vendor: Oracle Corporation Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_BASE: /opt/tomcat Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_HOME: /opt/tomcat Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dignore.endorsed.dirs= Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dcatalina.base=/opt/tomcat Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dcatalina.home=/opt/tomcat Jan 29, 2019 10:52:29 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp Jan 29, 2019 10:52:29 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib] Jan 29, 2019 10:52:30 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-nio-8080"] Jan 29, 2019 10:52:30 PM org.apache.catalina.core.StandardService initInternal SEVERE: Failed to initialize connector [Connector[org.apache.coyote.http11.Http11Protocol-8080]] org.apache.catalina.LifecycleException: Failed to initialize component [Connector[org.apache.coyote.http11.Http11Protocol-8080]] at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:552) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) at org.apache.catalina.startup.Catalina.load(Catalina.java:638) at org.apache.catalina.startup.Catalina.load(Catalina.java:661) 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:309) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:500) Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed at org.apache.catalina.connector.Connector.initInternal(Connector.java:995) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) ... 12 more Caused by: java.net.BindException: Address already in use at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:463) at sun.nio.ch.Net.bind(Net.java:455) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:219) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1087) at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:265) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:581) at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:68) at org.apache.catalina.connector.Connector.initInternal(Connector.java:993) ... 13 more

Jan 29, 2019 10:52:30 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["https-jsse-nio-8443"] Jan 29, 2019 10:52:31 PM org.apache.catalina.core.StandardService initInternal SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8443]] org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8443]] at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:552) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) at org.apache.catalina.startup.Catalina.load(Catalina.java:638) at org.apache.catalina.startup.Catalina.load(Catalina.java:661) 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:309) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:500) Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed at org.apache.catalina.connector.Connector.initInternal(Connector.java:995) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) ... 12 more Caused by: java.lang.IllegalArgumentException: Alias name [null] does not identify a key entry at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:115) at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:86) at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:244) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1087) at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:265) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:581) at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:68) at org.apache.catalina.connector.Connector.initInternal(Connector.java:993) ... 13 more Caused by: java.io.IOException: Alias name [null] does not identify a key entry at org.apache.tomcat.util.net.jsse.JSSEUtil.getKeyManagers(JSSEUtil.java:261) at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:113) ... 20 more

Jan 29, 2019 10:52:31 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-nio-8009"] Jan 29, 2019 10:52:31 PM org.apache.catalina.core.StandardService initInternal SEVERE: Failed to initialize connector [Connector[AJP/1.3-8009]] org.apache.catalina.LifecycleException: Failed to initialize component [Connector[AJP/1.3-8009]] at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:552) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) at org.apache.catalina.startup.Catalina.load(Catalina.java:638) at org.apache.catalina.startup.Catalina.load(Catalina.java:661) 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:309) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:500) Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed at org.apache.catalina.connector.Connector.initInternal(Connector.java:995) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) ... 12 more Caused by: java.net.BindException: Address already in use at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:463) at sun.nio.ch.Net.bind(Net.java:455) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:219) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1087) at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:265) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:581) at org.apache.catalina.connector.Connector.initInternal(Connector.java:993) ... 13 more

  • I tried to save it as <Connector port... /> but it was failed ,please understand in my config file I saved it as <Connector port... /> – Randeer Lalanga Jan 30 at 4:24
  • You have a BindException here. Is port 8443 already being used by another program? – Haxiel Jan 30 at 4:55
  • how do I check that? – Randeer Lalanga Jan 30 at 5:00
  • ss -ltn will show the ports currently listening. Look for port 8443 in that list. – Haxiel Jan 30 at 5:06
  • I ran the command "ss -ltn | grep 8443" , but it did not show me any output – Randeer Lalanga Jan 30 at 5:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.