2023-06-20 17:36:01 +02:00
|
|
|
== How to fix it in OpenSSL
|
|
|
|
|
|
|
|
=== Code examples
|
|
|
|
|
|
|
|
==== Noncompliant code example
|
|
|
|
|
2023-08-21 15:22:49 +02:00
|
|
|
[source,python,diff-id=11,diff-type=noncompliant]
|
2023-06-20 17:36:01 +02:00
|
|
|
----
|
|
|
|
from OpenSSL import SSL
|
|
|
|
|
|
|
|
SSL.Context(SSL.SSLv3_METHOD) # Noncompliant
|
|
|
|
----
|
|
|
|
|
|
|
|
==== Compliant solution
|
|
|
|
|
2023-08-21 15:22:49 +02:00
|
|
|
[source,python,diff-id=11,diff-type=compliant]
|
2023-06-20 17:36:01 +02:00
|
|
|
----
|
|
|
|
from OpenSSL import SSL
|
|
|
|
|
|
|
|
context = SSL.Context(SSL.TLS_SERVER_METHOD)
|
|
|
|
context.set_min_proto_version(SSL.TLS1_3_VERSION)
|
|
|
|
----
|
|
|
|
|
|
|
|
=== How does this work?
|
|
|
|
|
|
|
|
include::../../common/fix/fix.adoc[]
|