diff options
author | Georg Pfuetzenreuter | 2022-04-13 10:10:29 +0200 |
---|---|---|
committer | Georg Pfuetzenreuter | 2022-04-13 10:10:29 +0200 |
commit | fdffef6e139c54d28f1283b3831656f0d152defc (patch) | |
tree | 1a3360c0c95281af3c490840d0583f0e99048626 | |
parent | 840265c745e668addfcd4afa741f7835cd98dca9 (diff) | |
parent | 047f701396b043fe7968dc7c217fe2d4f6bd2958 (diff) | |
download | webreg-fdffef6e139c54d28f1283b3831656f0d152defc.tar.gz webreg-fdffef6e139c54d28f1283b3831656f0d152defc.tar.bz2 webreg-fdffef6e139c54d28f1283b3831656f0d152defc.zip |
Merge pull request 'TLS/SSL support for IRC connection' (#1) from ssl into master
Reviewed-on: https://git.com.de/LibertaCasa/webreg/pulls/1
-rw-r--r-- | irc_register.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/irc_register.py b/irc_register.py index 0492a86..7c87e96 100644 --- a/irc_register.py +++ b/irc_register.py @@ -7,16 +7,17 @@ def ircregister(username, password, email): d = irctokens.StatefulDecoder() e = irctokens.StatefulEncoder() s = socket.socket() + securesocket = ssl.create_default_context().wrap_socket(s, server_hostname="irc.casa") #connecting to the server - s.connect(("127.0.0.1", 6667)) + securesocket.connect(("theia.psyched.dev", 6697)) #defining the send function with proper formatting def _send(line): print(f"> {line.format()}") e.push(line) while e.pending(): - e.pop(s.send(e.pending())) + e.pop(securesocket.send(e.pending())) # registering the connection to the server _send(irctokens.build("USER", [username, "0", "*", username])) @@ -33,7 +34,7 @@ def ircregister(username, password, email): # go through the cases while True: - lines = d.push(s.recv(1024)) + lines = d.push(securesocket.recv(1024)) if lines == None: # if nothing is received from server return "server error" |