Twitch bot help! reddit / irc ---------------------------------------------------------------------- BAU3R_ · 2019-04-16 18:00 Trying to code a bot for a project, having trouble connecting to the irc server over ssl or port 6697. However, I can connect fine over port 6667? Here is the rough code, I think its based on some outdated methods. I’m still trying to do more research and figure it all out. [https://drive.google.com/drive/folders/1wVflvz7M7OC3QDsPtabVYwNDN0A5 KMCp?usp=sharing](https://drive.google.com/drive/folders/1wVflvz7M7OC3 QDsPtabVYwNDN0A5KMCp?usp=sharing) I appreciate any help! Edit: Should have mentioned this is in python and errors only when using port 6697 here, readbuffer = str(s.recv(1024)) ConnectionAbortedError: \[WinError 10053\] An established connection was aborted by the software in your host machine causing me to believe it could be an error in the way its written ​ Also have checked my system clock and made sue the firewall is not blocking this traffic ---------------------------------------------------------------------- mindlesstux · 2019-04-17 02:51 Looking at what you have written, I see no SSL connection handling. I just see a normal tcp socket handling. ---------------------------------------------------------------------- BAU3R_ · 2019-04-17 02:52 Okay, like I said I'm new to this and I'm learning so, what would be the difference etc. If you dont mine me asking ---------------------------------------------------------------------- mindlesstux · 2019-04-17 02:54 You setup a unencrypted socket, to do SSL you would need to basically build a ssl socket (other than data being encrypted its roughly the same...) [https://docs.python.org/2/library/ssl.html](https://docs.python.org/2 /library/ssl.html) ---------------------------------------------------------------------- BAU3R_ · 2019-04-17 02:54 Thank you so much for the reference, I will check this out tomorrow! ---------------------------------------------------------------------- mindlesstux · 2019-04-17 02:55 [https://docs.python.org/2/library/ssl.html#client-side- operation](https://docs.python.org/2/library/ssl.html#client-side- operation) \- might be more what you are in need of. ---------------------------------------------------------------------- Elronnd · 2019-04-17 17:14 I don't recommend speaking the irc protocol directly—there are irc- dedicated libraries which are much easier to use. That said, I agree with the sibling it looks like the problem is that you're not actually handling the ssl socket, which you have to do. You don't get encryption 'for free' by using port 6697, you have to actually encrypt the data. Fortunately, python makes it easy. Here's how I would write `opensocket()`, based on a python irc bot of my own: import ssl import socket ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) s = ssl_context.wrap_socket(socket.socket(), server_hostname=HOST) s.connect((HOST, PORT)) # etc. So, ultimately not that much more work. If something doesn't work, or you get a really weird error, you can try changing `ssl.PROTOCOL_TLSv1_2), you can change to ...`_TLSv1_1` or just plain ...`_TLSv1`, but that shouldn't be necessary. ---------------------------------------------------------------------- [deleted] · 2019-04-17 18:24 [deleted] ---------------------------------------------------------------------- BAU3R_ · 2019-04-17 18:25 I appreciate the answer alot, I meant to close or remove this post as I figured it out last night and in the process of fixing it. I'm actually a decently technical person and I just wasnt thinking about it that way. As obviously as you stated a standard TCP connection is different from a connection using SSL or tls. Thank you for the response. I really appreciate it! I've been pulled between sat studying and finals for multiple classes and a certification exam tomorrow. So I'm a little everywhere