Skip to content

Commit

Permalink
fixed ssl_ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
ampledata committed Sep 3, 2024
1 parent 9960dbd commit acf12f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dronecot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

"""Drone Open Remote ID to TAK Gateway."""

__version__ = "1.0.0-beta8"
__version__ = "1.0.0"

# COMPAT Python 3.6 test/build work-around:
try:
Expand Down
5 changes: 3 additions & 2 deletions dronecot/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ async def run(self, _=-1) -> None:
mqtt_username = self.config.get("MQTT_USERNAME")
mqtt_password = self.config.get("MQTT_PASSWORD")

if self.config.get("PYTAK_TLS_CLIENT_CERT"):
ssl_ctx = None
if self.config.get("MQTT_TLS_CLIENT_CERT"):
ssl_ctx = pytak.client_functions.get_ssl_ctx(self.config)

async with aiomqtt.Client(
Expand All @@ -138,7 +139,7 @@ async def run(self, _=-1) -> None:
username=mqtt_username or None,
password=mqtt_password or None,
client_id=client_id,
tls_context=ssl_ctx or None,
tls_context=ssl_ctx,
) as client:
self._logger.info("Connected to MQTT Broker %s:%d/%s", broker, port, topic)
async with client.messages() as messages:
Expand Down

0 comments on commit acf12f1

Please sign in to comment.