oz123 / pytest-localftpserver

A PyTest plugin which gives you a local ftp server for your tests
Other
16 stars 9 forks source link

`ssl.PROTOCOL_TLS` is deprecated #303

Closed milanmlft closed 2 months ago

milanmlft commented 5 months ago

When running tests with the ftpserver_TLS fixture, a deprecation warning is generated:

 /Users/milan/.pyenv/versions/3.10.13/envs/pixl-3.10.13/lib/python3.10/site-packages/pytest_localftpserver/helper_functions.py:84: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
    context = SSLContext(PROTOCOL_TLS)

Looks like PROTOCOL_TLS was deprecated since ssl version 3.10. This StackOverflow post suggests doing:

context = ssl.SSLContext( ssl.PROTOCOL_TLS_CLIENT )
context.minimum_version = ssl.TLSVersion.TLSv1_2
context.maximum_version = ssl.TLSVersion.TLSv1_3