A TLS context is created for SSL or TLS 1.0 or 1.1, which are broken

tx0/kotlin:weak-tls-versionrecommendedwarningsecurity/cryptodepth fastsecurity, cwe-326

What it finds

SSLContext.getInstance("SSL"), "SSLv3", "TLSv1" and "TLSv1.1" ask for protocols with known attacks, which servers and clients have dropped. "TLS" or "TLSv1.3" lets the strongest shared version win.

From the rule's source, weak_tls.rs.

Example from the rule's tests
import javax.net.ssl.SSLContext val old = SSLContext.getInstance("TLSv1")tx0 reports: TLSv1 is a broken protocol versionval ssl = SSLContext.getInstance("SSL")tx0 reports: SSL is a broken protocol versionval current = SSLContext.getInstance("TLS")
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 recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/kotlin:weak-tls-version" = "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:weak-tls-version] reason="..."

tx0 explain tx0/kotlin:weak-tls-version shows the same in the terminal. Found a false positive? Report it.