gpt4 book ai didi

rest - 为https配置tomcat后https请求无响应

转载 作者:行者123 更新时间:2023-11-28 23:25:50 24 4
gpt4 key购买 nike

我已经按照以下链接中提到的那样使用 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/

最佳答案

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

关于rest - 为https配置tomcat后https请求无响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37208312/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com