2021-04-26 17:29:13 +02:00
|
|
|
include::../description.adoc[]
|
2021-02-02 15:02:10 +01:00
|
|
|
|
2021-04-26 17:29:13 +02:00
|
|
|
== Noncompliant Code Example
|
2020-06-30 12:49:37 +02:00
|
|
|
|
2021-04-26 17:29:13 +02:00
|
|
|
``++javax.net.ssl.SSLContext++`` library:
|
2021-02-02 15:02:10 +01:00
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,kotlin]
|
2021-04-26 17:29:13 +02:00
|
|
|
----
|
|
|
|
val sc: SSLContext = SSLContext.getInstance("TLSv1.1") // Noncompliant
|
|
|
|
----
|
2020-06-30 12:49:37 +02:00
|
|
|
|
2021-04-26 17:29:13 +02:00
|
|
|
https://square.github.io/okhttp/[okhttp] library:
|
2021-02-02 15:02:10 +01:00
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,kotlin]
|
2021-04-26 17:29:13 +02:00
|
|
|
----
|
|
|
|
val spec: ConnectionSpec = ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
|
|
|
|
.tlsVersions(TlsVersion.TLS_1_1) // Noncompliant
|
|
|
|
.build()
|
|
|
|
----
|
2020-06-30 12:49:37 +02:00
|
|
|
|
2021-04-26 17:29:13 +02:00
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
``++javax.net.ssl.SSLContext++`` library:
|
2020-06-30 12:49:37 +02:00
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,kotlin]
|
2020-06-30 12:49:37 +02:00
|
|
|
----
|
2021-04-26 17:29:13 +02:00
|
|
|
val sc: SSLContext = SSLContext.getInstance("TLSv1.2") // Compliant
|
2020-06-30 12:49:37 +02:00
|
|
|
----
|
|
|
|
|
2021-04-26 17:29:13 +02:00
|
|
|
https://square.github.io/okhttp/[okhttp] library:
|
2020-06-30 12:49:37 +02:00
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,kotlin]
|
2020-06-30 12:49:37 +02:00
|
|
|
----
|
2021-04-26 17:29:13 +02:00
|
|
|
val spec: ConnectionSpec = ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
|
|
|
|
.tlsVersions(TlsVersion.TLS_1_2) // Compliant
|
|
|
|
.build()
|
2020-06-30 12:49:37 +02:00
|
|
|
----
|
|
|
|
|
|
|
|
include::../see.adoc[]
|
2021-06-02 20:44:38 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
2021-09-20 15:38:42 +02:00
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../message.adoc[]
|
|
|
|
|
|
|
|
include::../highlighting.adoc[]
|
|
|
|
|
2021-06-08 15:52:13 +02:00
|
|
|
'''
|
2021-06-02 20:44:38 +02:00
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
2021-06-03 09:05:38 +02:00
|
|
|
endif::env-github,rspecator-view[]
|