From 5a2830b6f8cd5b3ed549a32628b422532a6fee7d Mon Sep 17 00:00:00 2001 From: cfchou Date: Thu, 22 Sep 2016 16:39:14 +0800 Subject: [PATCH] disables verification of the server hostname in the server certificate --- hbmqtt/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hbmqtt/client.py b/hbmqtt/client.py index 45d4549..da34962 100644 --- a/hbmqtt/client.py +++ b/hbmqtt/client.py @@ -375,6 +375,8 @@ class MQTTClient: cadata=self.session.cadata) if 'certfile' in self.config and 'keyfile' in self.config: sc.load_cert_chain(self.config['certfile'], self.config['keyfile']) + if 'check_hostname' in self.config and isinstance(self.config['check_hostname'], bool): + sc.check_hostname = self.config['check_hostname'] kwargs['ssl'] = sc try: