Skip to content

Commit

Permalink
Add ssl fix
Browse files Browse the repository at this point in the history
ssl.SSLError: Cannot create a client socket with a PROTOCOL_TLS_SERVER context (_ssl.c:809)
  • Loading branch information
ddelange committed Jul 24, 2024
1 parent 1d2f8d9 commit b18309f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ci_helpers/run_integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
'integration-tests/test_207.py',
'integration-tests/test_http.py',
'integration-tests/test_ftp.py'
]
],
env={**os.environ, "PYTHONHTTPSVERIFY": '0'},
)

if os.environ.get('AWS_ACCESS_KEY_ID') and os.environ.get('AWS_SECRET_ACCESS_KEY'):
Expand Down
2 changes: 1 addition & 1 deletion smart_open/ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def convert_transport_params_to_args(transport_params):
def _connect(hostname, username, port, password, secure_connection, transport_params):
kwargs = convert_transport_params_to_args(transport_params)
if secure_connection:
ssl_context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH)
ssl_context = ssl.create_default_context(purpose=ssl.Purpose.SERVER_AUTH)
ftp = FTP_TLS(context=ssl_context, **kwargs)
else:
ftp = FTP(**kwargs)
Expand Down

0 comments on commit b18309f

Please sign in to comment.