简体   繁体   English

https连接和ajax请求

[英]https connection and ajax request

I have a site which is on HTTPS. 我有一个使用HTTPS的网站。 There I user jQuery AJAX to access webMethoid from the server. 我在那里使用jQuery AJAX从服务器访问webMethoid。 Is this webMethod called via HTTPS and is it safe? 通过HTTPS调用此webMethod,它安全吗?

Is this webMethod called via https 通过https调用此webMethod吗?

Yes. 是。 If it weren't, the ajax call would fail because of the Same Origin Policy , which requires that the document issuing the call and the call use the same protocol. 如果不是,则由于Same Origin Policy ,ajax调用将失败,这要求发出该调用的文档和该调用使用相同的协议。 (Unless you're using CORS , of course). (当然,除非您使用CORS )。

and is it safe ? 而且安全吗?

If by "safe" you mean "secured by SSL," yes. 如果“安全”是指“通过SSL保护”,则可以。

If by "safe" you mean "safe from the user spoofing it" (for instance, repeatedly voting on a vote site), no , the user can spoof it, so checks for that sort of thing have to be server-side. 如果“安全”是指“防止用户欺骗它”(例如,在投票站点上反复投票),则 ,用户可以欺骗它,因此必须在服务器端进行此类检查。

If your site is on https , you can call your method also via https . 如果您的网站位于https ,则也可以通过https调用您的方法。 It's as safe as you make it by design. 它和您设计时一样安全。 SSL is just part of your site's safety. SSL只是您网站安全的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM