Skip to content

Commit

Permalink
Change to 1-way SSL, remove client cert option #225
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickjaigner committed Jul 15, 2024
1 parent a31200f commit 88d88a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
3 changes: 1 addition & 2 deletions config/thingsboard.default.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"host": "0.0.0.0",
"access_token": "...",
"ca_cert": null,
"cert_file": null
"ca_cert": null
}
8 changes: 2 additions & 6 deletions packages/core/threads/thingsboard_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ def main(headless: bool = False) -> None:
)

# connect to MQTT broker
if config.thingsboard.ca_cert and config.thingsboard.cert_file:
client.connect(
tls=True,
ca_certs=config.thingsboard.ca_cert,
cert_file=config.thingsboard.cert_file,
)
if config.thingsboard.ca_cert:
client.connect(tls=True, ca_certs=config.thingsboard.ca_cert)
else:
client.connect()

Expand Down
2 changes: 0 additions & 2 deletions packages/core/types/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,12 @@ class ThingsBoardConfig(StricterBaseModel):
host: str
access_token: int
ca_cert: Optional[str]
cert_file: Optional[str]


class PartialThingsBoardConfig(StricterBaseModel):
host: Optional[str] = None
access_token: Optional[int] = None
ca_cert: Optional[str] = None
cert_file: Optional[str] = None


class Config(StricterBaseModel):
Expand Down

0 comments on commit 88d88a2

Please sign in to comment.