使用 ssl(https) 时请求构建器调用不返回
我正在使用 GWT。目前使用 gwt-rpc 进行登录身份验证。仅出于登录目的,我想使用 ssl(https),因此我尝试使用 Request Builder 并使用 https 调用 servlet,而不是使用 gwt-rpc。 当在 Servlet URL 中时,我使用 http 协议,请求生成器完美工作,响应返回到客户端(onResponseReceived)。但是当我在 servlet url 中使用 https 时,servlet 就会被调用,但响应不会返回到请求构建器的 onResponseReceived 方法。
我的 http 网址如下所示: http://localhost:8888/myproject/myservlet 使用 https 时,它看起来像:https://localhost/myproject/myservlet
请给出任何建议或者是否有任何建议还有其他方法可以做到这一点。并且还可以在 gwt-rpc 上使用 ssl 吗?
I am using GWT. Currently using gwt-rpc to for login authentication. For only login purpose i want to use ssl(https) and so instead of using gwt-rpc i am trying Request Builder and calling a servlet with https.
When in Servlet URL i use protocol as http the request builder works perfectly and response returns to client side(onResponseReceived ). but when i use https in the servlet url then the servlet is gettting called but the response is not returning to the onResponseReceived method of request builder.
my url with http looks like : http://localhost:8888/myproject/myservlet
and with https it looks like :https://localhost/myproject/myservlet
Please give any suggestion or is there any other way to do it.and also is it possible to use ssl over gwt-rpc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
浏览器同源策略正在阻止您的请求。
您的页面是通过 http 请求的,但您现在通过 https 进行 ajax 调用。这违反了同源政策。
为了解决这个问题,您应该通过 https 提供原始的 html/servlet。这确实会带来性能成本,但这是构建安全网站的唯一方法。
Browser Same origin policy is blocking your requests.
Your page was requested over http, but you are now making an ajax call over https. This is a violation of same origin policy.
To get around, you should serve your original html/servlet over https. This does have a performance cost, but it is the only way to build a secure website.
我不熟悉 GWT 和 Request Builder,但每当我在代码中遇到 HTTPS 连接问题时,都会归结为证书以及在客户端中安装正确的证书或告诉客户端代码在哪里按顺序查找证书对呼叫进行编码。
对于您的情况,这将是我想要探索的第一个途径。
I'm not familliar with GWT and Request Builder, but whenever I have had problems with HTTPS connections from my code it has come down to certificates and having the right certificate installed in the client or telling the client code where to find the certificate in order to encode the call.
That would be the first avenue I would want to explore in your situation.