我在应用程序中使用 SSL 时遇到问题。我做了以下事情:
我将以下段落添加到我的安全约束标签中:
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
并在 Tomcat 中的 Server.xml 中添加以下内容
<Connector port="8443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="c:/keystore.key"
keystorePass="mypassword" />
现在
https://localhost:8443/Appname/page.jsp
我得到以下信息
Secure Connection Failed
An error occurred during a connection to localhost:8443.
SSL received a record that exceeded the maximum permissible length.
(Error code: ssl_error_rx_record_too_long)
The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem. Alternatively, use the command found in the help menu to report this broken site.
有什么建议吗?
SSLEnabled
设置为 true
。
<Connector port="8443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="c:/keystore.key"
keystorePass="mypassword"
SSLEnabled="true" />
这还取决于您使用的浏览器。我自己在当地环境中也遇到了同样的问题。我在 Firefox 和 Chrome 中尝试过并遇到了这个问题。但是当我在阅读了谷歌上的几篇文章后在 Internet Explorer 中尝试时,它没有任何问题。
-谢谢
万一有人仍然面临这个问题,可能是您尝试在“http”而不是“https”上运行它,如果您使用的是jetbrains rider,请务必使用右上角旁边的https运行按钮