[TLS] You can now connect the bot over a ssl connection
This commit is contained in:
parent
4ffaf93969
commit
efbf1299f8
7
bot.py
7
bot.py
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/python3
|
||||
import socket, rich, asyncio, time, re
|
||||
import socket, rich, asyncio, time, re, ssl
|
||||
from config import *
|
||||
|
||||
class bot:
|
||||
|
@ -106,7 +106,12 @@ class bot:
|
|||
|
||||
readbuffer=""
|
||||
|
||||
|
||||
|
||||
s = socket.socket()
|
||||
ctx = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH)
|
||||
if tls == True:
|
||||
s = ctx.wrap_socket(s)
|
||||
s.connect((HOST, PORT))
|
||||
asyncio.run(bot.ConnectionSetup())
|
||||
|
||||
|
|
Loading…
Reference in New Issue