A connection goes to an http:// URL, unencrypted

tx0/kotlin:cleartext-http-urlstrictwarningsecurity/cryptodepth fastsecurity, cwe-319

What it finds

URL("http://api.example.com/login") sends the request and the answer in clear text, which anyone on the path can read and change. HTTPS protects them. Local addresses are left alone.

From the rule's source, cleartext_url.rs.

Example from the rule's tests
import java.net.URL val api = URL("http://api.example.com/login")tx0 reports: api.example.com is reached over unencrypted HTTPval local = URL("http://localhost:8080/")val secure = URL("https://api.example.com/login")
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/kotlin:cleartext-http-url" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/kotlin:cleartext-http-url] reason="..."

tx0 explain tx0/kotlin:cleartext-http-url shows the same in the terminal. Found a false positive? Report it.