
Improvement identified in #2790. Add a prefix to the diff-id when it is used multiple times in different "how to fix it in XYZ" sections to avoid ambiguity and pedantically follow the spec: > A single and unique diff-id should be used only once for each type of code example as shown in the description of a rule. Obvious typos around `diff-type` were fixed. An obvious extra use of diff blocks was removed.
27 lines
477 B
Plaintext
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_3_VERSION)
|
|
----
|
|
|
|
=== How does this work?
|
|
|
|
include::../../common/fix/fix.adoc[]
|