HTTPS连接错误

时间:2012-02-21 09:31:12

标签: java apache tomcat

我正在尝试使用http url connection连接到servlet,即http://localhost:9481/test/NewServlet。它对我来说很好。现在我想使用https://localhost:9481/test/NewServlet进行连接。我收到的错误如下:

  

错误代码:ssl_error_rx_record_too_long,连接被拒绝...

我是否需要在server.xml中编辑任何内容:

目前它看起来像:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" 
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" />

2 个答案:

答案 0 :(得分:1)

您似乎在server.xml中使用的是与测试请求中不同的端口。尝试点击https://localhost:8443/test/NewServlet

答案 1 :(得分:0)

默认情况下,Tomcat中的8443端口用于SSL连接。

我建议您查看SSL的tomcat文档:
http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html
希望这有帮助!

我发现还有一个链接可以立即解决您的问题:
http://java.dzone.com/articles/setting-ssl-tomcat-5-minutes 这是一篇很棒的文章。请继续解决此问题。

相关问题