@@ -5698,17 +5698,24 @@ def non_linux_skip_if_other_okay_error(self, err):
56985698 return # Expect the full test setup to always work on Linux.
56995699 if (isinstance (err , (ConnectionResetError , ConnectionAbortedError )) or
57005700 (isinstance (err , OSError ) and err .errno == errno .EINVAL ) or
5701- re .search ('wrong.version.number' , str (getattr (err , "reason" , "" )), re .I ) or
5702- re .search ('record.layer.failure' , str (getattr (err , "reason" , "" )), re .I )
5701+ re .search (
5702+ # Matches the following error messages:
5703+ # '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)'
5704+ # '[SSL: RECORD_LAYER_FAILURE] record layer failure (_ssl.c:1109)'
5705+ # '[SSL: HTTP_REQUEST] http request (_ssl.c:1143)'
5706+ r'wrong.version.number|record.layer.failure|http.request' ,
5707+ str (getattr (err , "reason" , "" )),
5708+ re .IGNORECASE ,
5709+ )
57035710 ):
57045711 # On Windows the TCP RST leads to a ConnectionResetError
57055712 # (ECONNRESET) which Linux doesn't appear to surface to userspace.
57065713 # If wrap_socket() winds up on the "if connected:" path and doing
57075714 # the actual wrapping... we get an SSLError from OpenSSL. This is
57085715 # typically WRONG_VERSION_NUMBER. The same happens on iOS, but
5709- # RECORD_LAYER_FAILURE is the error.
5716+ # RECORD_LAYER_FAILURE or HTTP_REQUEST is the error.
57105717 #
5711- # While appropriate, neither is the scenario we're specifically
5718+ # While appropriate, these scenarios aren't what we're specifically
57125719 # trying to test. The way this test is written is known to work on
57135720 # Linux. We'll skip it anywhere else that it does not present as
57145721 # doing so.
0 commit comments