【问题标题】:No response for https request after configuring Tomcat for https将Tomcat配置为https后,对https请求没有响应
【发布时间】:2016-05-13 10:59:26
【问题描述】:

我已经使用 SSL 配置了 Tomcat v7.0 服务器,如下面的链接所述。 https://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html#Configuration

对于通过 REST 客户端为我的 REST 服务发送的请求,我没有收到任何响应。 网址:https://localhost:8443/context/getData

但是,如果我点击以下 URL,则会成功响应。 http://localhost:8080/context/getData

如果我遗漏了一些东西来让它工作,请提出建议。

下面是 server.xml 连接器条目。

<Connector SSLEnabled="true" clientAuth="false" keystoreFile="C:\Users\Srivignesh\.keystore" keystorePass="changeit" maxThreads="150" port="8443" protocol="org.apache.coyote.http11.Http11Protocol" scheme="https" secure="true" sslProtocol="TLS"/> 

下面是 web.xml 条目。

<security-constraint>
  <web-resource-collection>
     <web-resource-name>Jersey RESTful Application</web-resource-name>
     <url-pattern>/*</url-pattern>
  </web-resource-collection>
  <user-data-constraint>
     <transport-guarantee>CONFIDENTIAL</transport-guarantee>
  </user-data-constraint>
</security-constraint> 

另外,当我在浏览器中输入下面的 URL 时,它显示证书无效错误,表明 https 已成功配置。

https://localhost:8443/

【问题讨论】:

  • didn't receive any response 是什么意思,必须有请求超时、连接重置、服务器错误(505)等响应。如果您分享您的server.xml 也会很有帮助。
  • 感谢您的回复。我在问题中添加了 server.xml 条目。正如我已经提到的,没有响应发送回 REST 客户端。没有错误代码,什么都没有。

标签: rest tomcat https


【解决方案1】:

在纠正了 2 个错误后得到了这个工作。 1. 对应于正确 TOMCAT 服务器的 server.xml 在工作区文件夹本身中可用。这需要针对连接器条目进行更新。 2. 使用的 REST 服务需要 JSON 输入。

【讨论】:

    猜你喜欢
    • 2018-02-03
    • 2020-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-08
    • 1970-01-01
    • 2017-04-23
    相关资源
    最近更新 更多