-1

我们从业务任务中得到将它们之间的安全连接升级到 TLS 1.3。我们使用的是 Java 8 / WildFly 8.2,所以我们想在那里尝试使用 Azule OpenJSSE 解决方案:

https://mvnrepository.com/artifact/org.openjsse

所以我将它安装在 ext 目录中,将提供程序添加到 java.security 并将依赖项添加到我们项目的 pom.xml。没有什么特别的事情发生,应用程序正常工作。现在我想尝试这些更改是否产生了一些效果。我有模拟应用程序,它试图以某种方式模拟我们的客户端外部服务器之一。

这是 Spring Boot 应用程序(2.1.3.RELEASE)。如果我添加到它的 pom.xml openjsse 依赖项并更改 application.properties:

server.ssl.enabled-protocols=TLSv1.3

我从 IntelliJ 运行它,它正常启动。但是如果我从 mvn package 创建包并且我正常运行这个 jar

java -jar target\mock.jar

我得到了这样的东西:


org.apache.catalina.LifecycleException: Protocol handler start failed
        at org.apache.catalina.connector.Connector.startInternal(Connector.java:1008) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.catalina.core.StandardService.addConnector(StandardService.java:226) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:259) [spring-boot-2.1.3.RELEAS
E.jar!/:2.1.3.RELEASE]
        at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:197) [spring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:311) [sp
ring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:164) [spr
ing-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) [spring-context-5.1.5.RELEASE.jar!/
:5.1.5.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) [spring-bo
ot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.3.RELEASE.jar!/:2.1.3.RELEASE]
        at com.abb.mock.server.mockserver.MockServerApplication.main(MockServerApplication.java:10) [classes!/:0.0.1-SNAPSHOT]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_172]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_172]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_172]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_172]
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [mock-server-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [mock-server-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [mock-server-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [mock-server-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
Caused by: java.lang.IllegalArgumentException: None of the [protocols] specified are supported by the SSL engine : [[TLSv1.3]]
        at org.apache.tomcat.util.net.SSLUtilBase.getEnabled(SSLUtilBase.java:112) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.tomcat.util.net.SSLUtilBase.<init>(SSLUtilBase.java:70) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.tomcat.util.net.jsse.JSSEUtil.<init>(JSSEUtil.java:150) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.tomcat.util.net.jsse.JSSEUtil.<init>(JSSEUtil.java:145) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.tomcat.util.net.jsse.JSSEImplementation.getSSLUtil(JSSEImplementation.java:50) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:102) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:85) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:224) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1085) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1171) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:568) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        at org.apache.catalina.connector.Connector.startInternal(Connector.java:1005) ~[tomcat-embed-core-9.0.16.jar!/:9.0.16]
        ... 22 common frames omitted

2020-08-12 08:22:13.743  INFO 18368 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-08-12 08:22:13.760  INFO 18368 --- [           main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-08-12 08:22:13.762 ERROR 18368 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

The Tomcat connector configured to listen on port 10443 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 10443, or configure this application to listen on another por
t.

2020-08-12 08:22:13.789  INFO 18368 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecuto
r'

我不明白,为什么会有不同。伙计们,你能帮帮我吗?:P

4

2 回答 2

0

您的控制台日志包含“配置为侦听端口 10443 的 Tomcat 连接器启动失败。该端口可能已在使用中,或者连接器可能配置错误。请检查您的端口是否已被使用并更改。也许您的应用程序仍然在您的 IDE 中运行并且端口仍然被阻塞?

编辑:正如评论中的建议,请同时使用 TLSv1.2 而不是 TLSv1.3。

于 2020-08-12T06:51:16.433 回答
0

您之前运行的端口 10443 未正确断开连接。尝试更改端口号或重新启动系统!

于 2020-08-12T11:42:54.777 回答