有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java中如何保护通过httpclient方法发送的密码

SCAVA安全扫描工具中可以看到,我的一些代码行存在漏洞。 脆弱性分类为:

Insufficient_Sensitive_Transport_Layer

易受攻击的代码包含 httpclient.addHeader()方法发送密码登录server/api。 应用程序是用java语言编写的

从谷歌,我知道我们可以添加一些加密方法来避免这个漏洞

HttpGet getMethod = null;
getMethod = new HttpGet("http/https url to connect");
getMethod.addHeader(USERNAME,PASSWORD); // Vulnerability reported in
//this line as it is sending the password without any protection.

如何防止此漏洞并通过某种加密方法安全地传递密码。 提前谢谢


共 (0) 个答案