Skip to content

tls_expiry deprecated protocol warning #1623

@cpina

Description

@cpina

In simplemonitor/Monitors/network.py there is:

        # Note: at time of writing, ssl does not support TLS1.3
        ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)

This is giving a warning:

/usr/bin/python3.11 /home/carles/git/simplemonitor-tls-expiry/tls_test.py 
/home/carles/git/simplemonitor-tls-expiry/tls_test.py:6: DeprecationWarning: ssl.PROTOCOL_TLSv1_2 is deprecated
  ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)

Process finished with exit code 0

It seems that the recommended way would be using ssl.PROTOCOL_TLS_CLIENT instead of ssl.PROTOCOL_TLSv1_2 (https://docs.python.org/3/library/ssl.html#ssl.PROTOCOL_TLS_CLIENT) which also enables CERT_REQUIRED and check_hostname by default (related to #1622 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions