== How to fix it in OkHttp

=== Code examples

==== Noncompliant code example

[source,kotlin,diff-id=11,diff-type=noncompliant]
----
import okhttp3.ConnectionSpec;
import okhttp3.TlsVersion;

fun main(args: Array<String>) {
    ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
          .tlsVersions(TlsVersion.TLS_1_1) // Noncompliant
          .build();
}
----

==== Compliant solution

[source,kotlin,diff-id=11,diff-type=compliant]
----
import okhttp3.ConnectionSpec;
import okhttp3.TlsVersion;

fun main(args: Array<String>) {
    ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
          .tlsVersions(TlsVersion.TLS_1_2)
          .build();
}
----

=== How does this work?

include::../../common/fix/fix.adoc[]
