@@ -501,17 +501,22 @@ def _mqtt_main(self):
501501
502502 # Create and set up the MQTT client.
503503 self ._event_client = mqtt .Client (
504- client_id = self ._event_client_id , transport = "websockets"
504+ client_id = self ._event_client_id , transport = self . _arlo . cfg . mqtt_transport
505505 )
506506 self ._event_client .on_log = self ._mqtt_on_log
507507 self ._event_client .on_connect = self ._mqtt_on_connect
508508 self ._event_client .on_message = self ._mqtt_on_message
509- self ._event_client .tls_set_context (ssl .create_default_context ())
509+ ssl_context = ssl .create_default_context ()
510+ ssl_context .check_hostname = self ._arlo .cfg .mqtt_hostname_check
511+ self ._event_client .tls_set_context (ssl_context )
510512 self ._event_client .username_pw_set (f"{ self ._user_id } " , self ._token )
511513 self ._event_client .ws_set_options (path = MQTT_PATH , headers = headers )
514+ self .debug (f"mqtt: host={ self ._arlo .cfg .mqtt_host } , "
515+ f"check={ self ._arlo .cfg .mqtt_hostname_check } , "
516+ f"transport={ self ._arlo .cfg .mqtt_transport } " )
512517
513518 # Connect.
514- self ._event_client .connect (MQTT_HOST , port = 443 , keepalive = 60 )
519+ self ._event_client .connect (self . _arlo . cfg . mqtt_host , port = 443 , keepalive = 60 )
515520 self ._event_client .loop_forever ()
516521
517522 except Exception as e :
@@ -671,7 +676,7 @@ def _auth(self):
671676 "Source" : "arloCamWeb" ,
672677 "User-Agent" : self ._user_agent ,
673678 "x-user-device-id" : self ._user_id ,
674- "x-user-device-name" : "QlJPV1NFUg==" ,
679+ "x-user-device-automation- name" : "QlJPV1NFUg==" ,
675680 "x-user-device-type" : "BROWSER" ,
676681 }
677682
@@ -822,7 +827,7 @@ def _validate(self):
822827 "User-Agent" : self ._user_agent ,
823828 "Source" : "arloCamWeb" ,
824829 "x-user-device-id" : self ._user_id ,
825- "x-user-device-name" : "QlJPV1NFUg==" ,
830+ "x-user-device-automation- name" : "QlJPV1NFUg==" ,
826831 "x-user-device-type" : "BROWSER" ,
827832 }
828833
0 commit comments