rspec/rules/S4423/kotlin/rule.adoc

57 lines
1.1 KiB
Plaintext
Raw Normal View History

include::../description.adoc[]
2021-02-02 15:02:10 +01:00
== Noncompliant Code Example
2020-06-30 12:49:37 +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]
----
val sc: SSLContext = SSLContext.getInstance("TLSv1.1") // Noncompliant
----
2020-06-30 12:49:37 +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]
----
val spec: ConnectionSpec = ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
.tlsVersions(TlsVersion.TLS_1_1) // Noncompliant
.build()
----
2020-06-30 12:49:37 +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
----
val sc: SSLContext = SSLContext.getInstance("TLSv1.2") // Compliant
2020-06-30 12:49:37 +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
----
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[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../highlighting.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]