Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用https的tomcat在直接使用TCP连接时获得关闭等待_Java_Sockets_Tomcat_Tcp - Fatal编程技术网

Java 使用https的tomcat在直接使用TCP连接时获得关闭等待

Java 使用https的tomcat在直接使用TCP连接时获得关闭等待,java,sockets,tomcat,tcp,Java,Sockets,Tomcat,Tcp,我使用tomcat 8.5.4在端口443上构建基于https的服务器,如下所示: 94 <Connector 95 protocol="org.apache.coyote.http11.Http11NioProtocol" 96 port="8000" maxThreads="200" 97 scheme="https" secure="true" SSLEnabled="true" 98

我使用tomcat 8.5.4在端口443上构建基于https的服务器,如下所示:

 94     <Connector
 95            protocol="org.apache.coyote.http11.Http11NioProtocol"
 96            port="8000" maxThreads="200"
 97            scheme="https" secure="true" SSLEnabled="true"
 98            keystoreFile="conf/rs_keystore.jks" keystorePass="ntsdawn"
 99            clientAuth="false" sslProtocol="TLS"/>
 70     <Connector port="8000" protocol="org.apache.coyote.http11.Http11NioProtocol"
 71                connectionTimeout="20000"
 72                redirectPort="8443" />
连接将保持在关闭状态,永远等待

但是,如果我修改server.xml,请使用http而不是https,如下所示:

 94     <Connector
 95            protocol="org.apache.coyote.http11.Http11NioProtocol"
 96            port="8000" maxThreads="200"
 97            scheme="https" secure="true" SSLEnabled="true"
 98            keystoreFile="conf/rs_keystore.jks" keystorePass="ntsdawn"
 99            clientAuth="false" sslProtocol="TLS"/>
 70     <Connector port="8000" protocol="org.apache.coyote.http11.Http11NioProtocol"
 71                connectionTimeout="20000"
 72                redirectPort="8443" />
70
那么一切都好了。TCP连接来了,当客户端发送FIN时,我的服务器将回复FIN


我的https配置有什么问题吗?

tomcat 8.5.4中有一个错误,在TLS握手完成之前,当套接字连接断开时,TLS连接进入循环。升级到tomcat 8.5.5或更高版本应该可以解决这个问题

下面是bug


HTTPs apache libs也可能存在问题。从httpcore-osgi-4.4.11的apache发行说明中,我发现“httpcore-osgi”库中修复了两个可能相关的bug: 错误修复:更正了由相反端点启动的SSL会话终止的处理 (从主机上向后移植)。 由Oleg Kalnichevski提供

Bug fix: corrected handling of NEED_WRAP handshake status during graceful SSL session termination
(back-ported from master).
Contributed by Oleg Kalnichevski <olegk at apache.org>
错误修复:纠正了在正常SSL会话终止过程中需要包装握手状态的处理
(从主机上向后移植)。
由Oleg Kalnichevski提供
链接供参考: