Preserve SSL handshake errors order

Sets are unordered and list with push/pop acts as LIFO, though we need FIFO.
Since the number of elements is tiny, no need to use deque.

Addresses #9120
This commit is contained in:
Andrey Gursky 2018-05-15 22:43:57 +02:00 committed by Philipp Hörist
parent f13ff8ac68
commit 4f29e2b353
1 changed files with 2 additions and 1 deletions

View File

@ -1333,7 +1333,8 @@ class Connection(CommonConnection, ConnectionHandlers):
ssl_errors = con.Connection.ssl_errors
ignored_ssl_errors = self._get_ignored_ssl_errors()
self._ssl_errors = set(ssl_errors) - set(ignored_ssl_errors)
self._ssl_errors = [n for n in ssl_errors if n not in ignored_ssl_errors]
self._ssl_errors.reverse()
self.process_ssl_errors()
def _get_ignored_ssl_errors(self):