@@ -136,6 +136,18 @@ class RemoteConnection:
136136    """ 
137137
138138    browser_name  =  None 
139+     # Keep backward compatibility for AppiumConnection - https://github.com/SeleniumHQ/selenium/issues/14694 
140+     import  os 
141+     import  socket 
142+ 
143+     import  certifi 
144+ 
145+     _timeout  =  (
146+         float (os .getenv ("GLOBAL_DEFAULT_TIMEOUT" , str (socket .getdefaulttimeout ())))
147+         if  os .getenv ("GLOBAL_DEFAULT_TIMEOUT" ) is  not   None 
148+         else  socket .getdefaulttimeout ()
149+     )
150+     _ca_certs  =  os .getenv ("REQUESTS_CA_BUNDLE" ) if  "REQUESTS_CA_BUNDLE"  in  os .environ  else  certifi .where ()
139151    _client_config : ClientConfig  =  None 
140152
141153    system  =  platform .system ().lower ()
@@ -296,6 +308,9 @@ def __init__(
296308            init_args_for_pool_manager = init_args_for_pool_manager ,
297309        )
298310
311+         # Keep backward compatibility for AppiumConnection - https://github.com/SeleniumHQ/selenium/issues/14694 
312+         RemoteConnection ._timeout  =  self ._client_config .timeout 
313+         RemoteConnection ._ca_certs  =  self ._client_config .ca_certs 
299314        RemoteConnection ._client_config  =  self ._client_config 
300315
301316        if  remote_server_addr :
@@ -375,7 +390,7 @@ def execute(self, command, params):
375390        LOGGER .debug ("%s %s %s" , command_info [0 ], url , str (trimmed ))
376391        return  self ._request (command_info [0 ], url , body = data )
377392
378-     def  _request (self , method , url , body = None ,  timeout = 120 ):
393+     def  _request (self , method , url , body = None ):
379394        """Send an HTTP request to the remote server. 
380395
381396        :Args: 
@@ -397,12 +412,12 @@ def _request(self, method, url, body=None, timeout=120):
397412            body  =  None 
398413
399414        if  self ._client_config .keep_alive :
400-             response  =  self ._conn .request (method , url , body = body , headers = headers , timeout = timeout )
415+             response  =  self ._conn .request (method , url , body = body , headers = headers , timeout = self . _client_config . timeout )
401416            statuscode  =  response .status 
402417        else :
403418            conn  =  self ._get_connection_manager ()
404419            with  conn  as  http :
405-                 response  =  http .request (method , url , body = body , headers = headers , timeout = timeout )
420+                 response  =  http .request (method , url , body = body , headers = headers , timeout = self . _client_config . timeout )
406421            statuscode  =  response .status 
407422        data  =  response .data .decode ("UTF-8" )
408423        LOGGER .debug ("Remote response: status=%s | data=%s | headers=%s" , response .status , data , response .headers )
0 commit comments