403在安全的双向ssl环境中调用Web服务时的禁止响应

时间:2016-10-10 00:39:10

标签: web-services rest tomcat ssl java-ee

我使用apache cfx实现了一个安静的Web服务。 Web服务的URL类似于htts:// hostname:port / ServiceName / param1 / param2 / param3。

它在tomcat强化环境中运行,在web xml安全约束中配置如下。

<security-constraint>
    <web-resource-collection>
        <web-resource-name>Source Name</web-resource-name>
        <url-pattern>/ServiceName</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>ws-role-name</role-name>
        <role-name>ws-admin-role-name</role-name>
    </auth-constraint>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>

这是在启用了2路SSL的相同配置环境中测试的,我能够成功使用curl命令调用Web服务。但是在另一个启用了相同tomcat强化并且在调用Web服务时支持双向SSL的环境中,我收到了以下错误。

    < HTTP/1.1 403 Forbidden
< Content-Type: text/html;charset=utf-8
< Content-Language: en
< Content-Length: 1027
< Vary: Accept-Encoding
< Date: Sat, 10 Oct 2016 01:02:23 GMT
< Server: Jetty
< 
<html><head><title>Jetty - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 403 - Access to the requested resource has been denied</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Access to the requested resource has been denied</u></p><p><b>description</b> <u>Access to the specified resource has been forbidden.</u></p><HR size="1" noshade="noshade"><h3>Jetty</h3></body></ht* Connection #0 to host host name left intact
* Closing connection #0

但是一旦url-pattern改为,

<url-pattern>/ServiceName/*</url-pattern>

我能够调用Web服务并以例外方式接收响应。但是在与此相同的其他环境中,这工作正常(tomcat强化2路ssl启用)。

tomcat强化或双向SSL中是否有任何配置可能是上述问题的原因?

0 个答案:

没有答案