@@ -845,7 +845,27 @@ async def connect(self) -> None:
845
845
if self .websocket is None and not self ._connecting :
846
846
self ._connecting = True
847
847
848
- connect_args : Dict [str , Any ] = {}
848
+ connect_args : Dict [str , Any ] = {
849
+ "url" : self .url ,
850
+ "headers" : self .headers ,
851
+ "auth" : self .auth ,
852
+ "heartbeat" : self .heartbeat ,
853
+ "origin" : self .origin ,
854
+ "params" : self .params ,
855
+ "protocols" : self .supported_subprotocols ,
856
+ "proxy" : self .proxy ,
857
+ "proxy_auth" : self .proxy_auth ,
858
+ "proxy_headers" : self .proxy_headers ,
859
+ "timeout" : self .websocket_close_timeout ,
860
+ "receive_timeout" : self .receive_timeout ,
861
+ }
862
+
863
+ if self .ssl is not None :
864
+ connect_args .update (
865
+ {
866
+ "ssl" : self .ssl ,
867
+ }
868
+ )
849
869
850
870
# Adding custom parameters passed from init
851
871
if self .connect_args :
@@ -857,19 +877,6 @@ async def connect(self) -> None:
857
877
# Set the _connecting flag to False after in all cases
858
878
self .websocket = await asyncio .wait_for (
859
879
self .session .ws_connect (
860
- url = self .url ,
861
- headers = self .headers ,
862
- auth = self .auth ,
863
- heartbeat = self .heartbeat ,
864
- origin = self .origin ,
865
- params = self .params ,
866
- protocols = self .supported_subprotocols ,
867
- proxy = self .proxy ,
868
- proxy_auth = self .proxy_auth ,
869
- proxy_headers = self .proxy_headers ,
870
- timeout = self .websocket_close_timeout ,
871
- receive_timeout = self .receive_timeout ,
872
- ssl = self .ssl ,
873
880
** connect_args ,
874
881
),
875
882
self .connect_timeout ,
0 commit comments