2016-05-13 58 views
0

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

对于通过REST客户端为我的REST服务发送的请求,我没有收到任何响应。 URL: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/

+0

你是什么意思'没有收到任何回应'必须有一个响应,如请求Tiimeout,连接重置,服务器错误(505)蚀刻。如果你分享你的'server.xml',这将会很有帮助。 – Mahendra

+0

感谢您的回复。我在问题中添加了server.xml条目。正如我已经提到的那样,没有回复给REST客户端。没有错误代码,没有。 – Srivignesh

回答

0

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