Zum Inhalt springen

Cleartext HTTP (ARCH4118)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key java.security.cleartext-http · Severity warning · Category security · CWE CWE-319

Carrying sensitive data over http:// exposes traffic in cleartext to network eavesdroppers. Use TLS (https://) for all sensitive calls.

String url = "http://api.example.com/login";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.POST(BodyPublishers.ofString(credentials))
.build();
String url = "https://api.example.com/login";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.POST(BodyPublishers.ofString(credentials))
.build();

Use https:// instead of http:// for sensitive endpoints and keep TLS validation enabled.