我正在创建一个使用HTTPS的基于API的安全web;然而,如果我允许用户配置它(包括发送密码)使用查询字符串这也将是安全的,或者我应该强制它通过POST?


当前回答

是的,只要没人越过你的肩膀看显示器。

其他回答

您可以发送密码作为MD5哈希参数与一些盐添加。在服务器端比较它的身份验证。

是的,只要没人越过你的肩膀看显示器。

是的。HTTPS会话的整个文本都由SSL保护。这包括查询和报头。在这方面,POST和GET完全相同。

至于你的方法的安全性,没有经过适当的检查,也很难说。

是的,从建立HTTPS连接的那一刻起,一切都是安全的。查询字符串(GET)作为POST通过SSL发送。

From a "sniff the network packet" point of view a GET request is safe, as the browser will first establish the secure connection and then send the request containing the GET parameters. But GET url's will be stored in the users browser history / autocomplete, which is not a good place to store e.g. password data in. Of course this only applies if you take the broader "Webservice" definition that might access the service from a browser, if you access it only from your custom application this should not be a problem.

所以使用post至少密码对话框应该是首选的。另外,正如littlegeek在链接中指出的那样,GET URL更有可能写入你的服务器日志。