[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-15 Thread Christian Heimes


Christian Heimes  added the comment:

Users will now get an error message when they are trying to compile against an 
OpenSSL build without thread support.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-15 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset efc9065904c4df8962e04303c2c03642f45019b5 by Christian Heimes in 
branch '3.7':
[3.7] bpo-40515: Require OPENSSL_THREADS (GH-19953) (GH-20120)
https://github.com/python/cpython/commit/efc9065904c4df8962e04303c2c03642f45019b5


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-15 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 387c7441f589cc45ea86f1fa257af616c39d9a4b by Christian Heimes in 
branch '3.8':
[3.8] bpo-40515: Require OPENSSL_THREADS (GH-19953) (GH-20119)
https://github.com/python/cpython/commit/387c7441f589cc45ea86f1fa257af616c39d9a4b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-15 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +19424
pull_request: https://github.com/python/cpython/pull/20120

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-15 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +19423
pull_request: https://github.com/python/cpython/pull/20119

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-15 Thread miss-islington


miss-islington  added the comment:


New changeset c087a268a4d4ead8ef2ca21e325423818729da89 by Christian Heimes in 
branch 'master':
bpo-40515: Require OPENSSL_THREADS (GH-19953)
https://github.com/python/cpython/commit/c087a268a4d4ead8ef2ca21e325423818729da89


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-06 Thread Christian Heimes


Change by Christian Heimes :


--
keywords: +patch
pull_requests: +19269
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19953

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-05 Thread Christian Heimes


Christian Heimes  added the comment:

It not about what I wish or wish not to do.

Python requires thread-safe libraries. A library without proper locking and 
thread safety is no longer safe to use without great effort and careful locking 
in the glue code. A non-threaded OpenSSL build will lead to memory corruption 
and eventually crash the interpreter.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-05 Thread Miguel


Miguel  added the comment:

I built with 'no-threads' option.
I understand if you no longer wish to support non-threaded SSL. 
But it just seemed to me that you could if you protected the SSL API calls with 
locking since I can get all your ssl tests to work with this minor change.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-05 Thread Christian Heimes


Christian Heimes  added the comment:

How did you build OpenSSL 1.1.1d? Python assumes default build of OpenSSL. 
Since Python is now always multi-threaded we no longer support non-threaded 
OpenSSL builds.

--
versions:  -Python 3.5, Python 3.6, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-05 Thread Miguel


New submission from Miguel :

Hello, this is my first python bug report!

I've been running builds of Python 3.7.x on CentOS Linux release 7.7 
(64bit/Intel Core
2 Duo) 
and I ran into hangs with test_ssl.py when using latest SSL 1.1.1d sources.

I've done a full compilation from source for Python 3.7.7 and SSL 1.1 in my
workspaces.

>From what I can tell the problem is when SSL 1.1 is built with no threading
there is no locking enabled by python.

This one line change will make the hangs in test_ssl.py  go away:

Index: Modules/_ssl.c

--- Modules/_ssl.c  (revision 70)
+++ Modules/_ssl.c  (working copy)
@@ -5875,7 +5875,7 @@
 if (!_setup_ssl_threads()) {
 return NULL;
 }
-#elif OPENSSL_VERSION_1_1 && defined(OPENSSL_THREADS)
+#elif OPENSSL_VERSION_1_1
 / OpenSSL 1.1.0 builtin thread support is enabled /
 _ssl_locks_count++;

# endif

There appears to be an assumption in _ssl.c and test_ssl.y that SSL 1.1 will be
threaded
but this may not be true (as in my case).

Appreciate any feedback. Thanks!

--
assignee: christian.heimes
components: SSL
messages: 368143
nosy: christian.heimes, mig28suarez
priority: normal
severity: normal
status: open
title: test_ssl.py hangs with SSL 1.1 built with no threads
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com