kopia lustrzana https://github.com/mate-dev/meshtastic-matrix-relay
Integrating Certifi to fix cert probs w some sites
rodzic
37235d2e4a
commit
b6af966ee0
8
main.py
8
main.py
|
@ -8,6 +8,8 @@ import logging
|
|||
import re
|
||||
import sqlite3
|
||||
import yaml
|
||||
import certifi
|
||||
import ssl
|
||||
import meshtastic.tcp_interface
|
||||
import meshtastic.serial_interface
|
||||
from nio import AsyncClient, AsyncClientConfig, MatrixRoom, RoomMessageText, RoomAliasEvent, RoomMessageNotice
|
||||
|
@ -260,7 +262,11 @@ async def main():
|
|||
# Initialize the SQLite database
|
||||
initialize_database()
|
||||
|
||||
config = AsyncClientConfig(encryption_enabled=False)
|
||||
# Create SSL context using certifi's certificates
|
||||
ssl_context = ssl.create_default_context(cafile=certifi.where())
|
||||
|
||||
# Initialize the Matrix client with custom SSL context
|
||||
config = AsyncClientConfig(encryption_enabled=False, ssl=ssl_context)
|
||||
matrix_client = AsyncClient(matrix_homeserver, bot_user_id, config=config)
|
||||
matrix_client.access_token = matrix_access_token
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue