java 使用 https 的 Web 服务身份验证给出错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7214211/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 19:07:04  来源:igfitidea点击:

Web service authentication using https giving error

javaweb-servicesauthenticationssl

提问by SSG

I have written a simple web service and used digest and HTTPS authentication to secure it. I have generated my certificate using keytool present in Java. When I deploy the web-service in Tomcat by creating a .war file, the welcome page of axis is properly being displayed, but when I click on services its giving the following error,

我编写了一个简单的 Web 服务并使用摘要和 HTTPS 身份验证来保护它。我已经使用 Java 中的 keytool 生成了我的证书。当我通过创建 .war 文件在 Tomcat 中部署 web 服务时,轴的欢迎页面正确显示,但是当我单击服务时,它给出以下错误,

javax.servlet.ServletException: https is forbidden
org.apache.axis2.transport.http.AxisServlet.preprocessRequest(AxisServlet.java:612)
org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

The error is not being displayed when I deploy a website with a servlet. The problem is appearing only when I deploy the axis web services.

使用 servlet 部署网站时未显示错误。只有在我部署轴 Web 服务时才会出现问题。

采纳答案by Prabath Siriwardena

If you want to use https, then you need to set up axis2.xml as described in the following document:

如果要使用https,则需要按照以下文档中的说明设置axis2.xml:

http://axis.apache.org/axis2/java/core/docs/servlet-transport.html

http://axis.apache.org/axis2/java/core/docs/servlet-transport.html