Tomcat 10 Порт 8443 (SSL) не работает на локальном / внешнем IP-адресе, но работает на localhost
Я пытался настроить Tomcat 10.0.4 вместе с IntelliJ Idea для моего веб-проекта Java. Однако я не могу запустить проект, используя SSL на порту 8443. Я также включил dll Tomcat Native Library в папку bin tomcat. В настройках конфигурации сборки в IntelliJ я также включил номер порта для HTTPS.
После сборки и запуска сервера https: // localhost:8443 работает должным образом. Однако, когда я пытаюсь получить доступ к веб-серверу, используя локальный IP-адрес (192.168.1.2) или через мой внешний IP-адрес, хром выплевывает
У меня включена переадресация портов для портов 80, 443 и 8443 (что работает, учитывая, что порт 80 работает нормально), но 8443 не работает. В Windows 10 я также разрешил входящее и исходящее подключение к 8443 в настройках брандмауэра.
Ниже мой server.xml
<?xml version="1.0" encoding="UTF-8"?>
<Server port="-1" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" useAprConnector="true" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
executor="tomcatThreadPool"
connectionTimeout="20000"
redirectPort="8443"
useIPVHosts="true"
address="0.0.0.0"/>
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="150" SSLEnabled="true" URIEncoding="UTF-8"
secure="true" SSLEngine="true" scheme="https" clientAuth="false"
sslProtocol="TLS">
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig>
<Certificate
certificateKeyFile="conf/privkey1.pem"
certificateFile="conf/cert1.pem"
certificateChainFile="conf/chain1.pem"
type="RSA" />
</SSLHostConfig>
</Connector>
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b"
resolveHosts="true"/>
</Host>
</Engine>
</Service>
</Server>
Будем очень благодарны любой помощи!
Обновление (24.04.2021 в 17:07 Следующие сообщения журнала при запуске:
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
24-Apr-2021 17:00:26.698 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match [Server/Listener] failed to set property [useAprConnector] to [true]
24-Apr-2021 17:00:26.811 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match [Server/Service/Connector] failed to set property [SSLEngine] to [true]
24-Apr-2021 17:00:26.811 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match [Server/Service/Connector] failed to set property [clientAuth] to [false]
24-Apr-2021 17:00:26.812 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match [Server/Service/Connector] failed to set property [sslProtocol] to [TLS]
24-Apr-2021 17:00:26.868 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match [Server/Service/Engine/Host/Valve] failed to set property [resolveHosts] to [true]
24-Apr-2021 17:00:26.871 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/10.0.4
24-Apr-2021 17:00:26.871 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Mar 5 2021 11:07:15 UTC
24-Apr-2021 17:00:26.871 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 10.0.4.0
24-Apr-2021 17:00:26.871 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
24-Apr-2021 17:00:26.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0
24-Apr-2021 17:00:26.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
24-Apr-2021 17:00:26.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk-11.0.10
24-Apr-2021 17:00:26.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 11.0.10+8-LTS-162
24-Apr-2021 17:00:26.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
24-Apr-2021 17:00:26.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\MicroTechTon\AppData\Local\JetBrains\IntelliJIdea2021.1\tomcat\6454be16-6e63-47f0-9175-b6e43d48845f
24-Apr-2021 17:00:26.872 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 10.0
24-Apr-2021 17:00:26.873 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
24-Apr-2021 17:00:26.873 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
24-Apr-2021 17:00:26.873 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
24-Apr-2021 17:00:26.873 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
24-Apr-2021 17:00:26.874 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
24-Apr-2021 17:00:26.874 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\MicroTechTon\AppData\Local\JetBrains\IntelliJIdea2021.1\tomcat\6454be16-6e63-47f0-9175-b6e43d48845f\conf\logging.properties
24-Apr-2021 17:00:26.874 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
24-Apr-2021 17:00:26.874 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
24-Apr-2021 17:00:26.874 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
24-Apr-2021 17:00:26.874 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
24-Apr-2021 17:00:26.874 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\MicroTechTon\AppData\Local\JetBrains\IntelliJIdea2021.1\tomcat\6454be16-6e63-47f0-9175-b6e43d48845f\jmxremote.password
24-Apr-2021 17:00:26.874 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\MicroTechTon\AppData\Local\JetBrains\IntelliJIdea2021.1\tomcat\6454be16-6e63-47f0-9175-b6e43d48845f\jmxremote.access
24-Apr-2021 17:00:26.874 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
24-Apr-2021 17:00:26.875 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
24-Apr-2021 17:00:26.875 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
24-Apr-2021 17:00:26.875 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
24-Apr-2021 17:00:26.875 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\MicroTechTon\AppData\Local\JetBrains\IntelliJIdea2021.1\tomcat\6454be16-6e63-47f0-9175-b6e43d48845f
24-Apr-2021 17:00:26.875 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 10.0
24-Apr-2021 17:00:26.875 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 10.0\temp
24-Apr-2021 17:00:26.879 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.28] using APR version [1.7.0].
24-Apr-2021 17:00:26.880 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [true].
24-Apr-2021 17:00:26.884 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1k 25 Mar 2021]
24-Apr-2021 17:00:27.200 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-0.0.0.0-80"]
24-Apr-2021 17:00:27.228 INFO [main] org.apache.coyote.http11.AbstractHttp11Protocol.configureUpgradeProtocol The ["https-openssl-apr-8443"] connector has been configured to support negotiation to [h2] via ALPN
24-Apr-2021 17:00:27.228 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["https-openssl-apr-8443"]
24-Apr-2021 17:00:27.339 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [783] milliseconds
24-Apr-2021 17:00:27.411 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
24-Apr-2021 17:00:27.411 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/10.0.4]
24-Apr-2021 17:00:27.428 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-0.0.0.0-80"]
24-Apr-2021 17:00:27.449 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["https-openssl-apr-8443"]
24-Apr-2021 17:00:27.457 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [117] milliseconds
Connected to server