Egon Okerman 054e47fcb7
Modify rule S4423: Adjust Python compliant examples (APPSEC-1556) (#3688)
* Use recommended helper method in compliant solution

* Change minimal version to TLSv1.2 (to match other languages)
2024-02-29 12:36:15 +01:00

27 lines
477 B
Plaintext

== How to fix it in OpenSSL
=== Code examples
==== Noncompliant code example
[source,python,diff-id=11,diff-type=noncompliant]
----
from OpenSSL import SSL
SSL.Context(SSL.SSLv3_METHOD) # Noncompliant
----
==== Compliant solution
[source,python,diff-id=11,diff-type=compliant]
----
from OpenSSL import SSL
context = SSL.Context(SSL.TLS_SERVER_METHOD)
context.set_min_proto_version(SSL.TLS1_2_VERSION)
----
=== How does this work?
include::../../common/fix/fix.adoc[]