Skip to content

Problem while running the test server - irc: TLS handshake failed #1

@rkazak

Description

@rkazak

Hi - I am trying to run the test server on a mac mini using
MacOS 15.6.1
Python 3.13.7

Here is the logged output from the test server

mini.local >python3 weercd.py
weercd 1.0.0-dev - WeeChat IRC testing server
Options: {'host': None, 'port': 7777, 'file': None, 'maxchans': 5, 'maxnicks': 100, 'nickused': 0, 'notice': ['user', 'channel'], 'sleep': 0, 'wait': 0, 'debug': False}
Listening on port 7777 (ctrl-C to exit)
Connection from ('127.0.0.1', 53475)
Traceback (most recent call last):
File "/Users/rkazak/weechat.d/weercd/weercd.py", line 557, in
main()
~~~~^^
File "/Users/rkazak/weechat.d/weercd/weercd.py", line 547, in main
client = Client(clientsock, addr, args)
File "/Users/rkazak/weechat.d/weercd/weercd.py", line 138, in init
self.connect()
~~~~~~~~~~~~^^
File "/Users/rkazak/weechat.d/weercd/weercd.py", line 205, in connect
self.recv(0.1)
~~~~~~~~~^^^^^
File "/Users/rkazak/weechat.d/weercd/weercd.py", line 197, in recv
msgs = self.conn.read(timeout)
File "/Users/rkazak/weechat.d/weercd/weercd.py", line 97, in read
data = data.decode("UTF-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdc in position 12: invalid continuation byte

Has anyone encountered this previously?

This article seems to describe the situation I am seeing, and I am using it as a debug starting point.

Another observation is that while trying to debug the issue, for each execution I did the location of the invalid byte moved?

data = data.decode("UTF-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf5 in position 15: invalid start byte

data = data.decode("UTF-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 11: invalid start byte

The 'packet' contents that get received is

============ Debug ==========
contents 'b'\x16\x03\x01\x01v\x01\x00\x01r\x03\x03H\xab|\xcd\xeff\xe0/\x8a\xb0\xac")E\xfb\x95\x844w\x14n\x8ed\x06\xfa\xcd\xac\x0ce\xfe\x19M \xeb,\x01n\xdb\xdc\xf1,\xa7+\x86((#\xa7\x83\xdf\xda\x0e\xe9\xdc\x1e2\xc3n\xca\xe2\xf6ZE7^\x00:\x13\x02\x13\x03\x13\x01\x13\x04\xc0,\xcc\xa9\xc0\xad\xc0\n\xc0+\xc0\xac\xc0\t\xc00\xcc\xa8\xc0\x14\xc0/\xc0\x13\x00\x9d\xc0\x9d\x005\x00\x9c\xc0\x9c\x00/\x00\x9f\xcc\xaa\xc0\x9f\x009\x00\x9e\xc0\x9e\x003\x01\x00\x00\xef\x00\x1c\x00\x02@\x01\x00\x16\x00\x00\x00\x17\x00\x00\x00\x05\x00\x05\x01\x00\x00\x00\x00\x00\r\x00(\x00&\t\x04\t\x05\t\x06\x04\x01\x08\t\x08\x04\x04\x03\x08\x07\x05\x01\x08\n\x08\x05\x05\x03\x08\x08\x06\x01\x08\x0b\x08\x06\x06\x03\x02\x01\x02\x03\x003\x00k\x00i\x00\x17\x00A\x043?\x08eb\xd9\xfe\xf2\xbf\x7f7\xd3Q{\xb0\xc62!\x943T\xcd\xf5R6\xa5\xa9V\x8f\xb0Q\x9b\x0c\x9aa\xf7&oB\xbaa\x97d\x02\x17\x8f\x04\xa6\xe3\n\x97\x9f\x9fgeU\xbc8N_\x80\xe9\xc7\xe8\x00\x1d\x00 \x13\x17\x92\xce&,VV\x02\x7f!\xa1NM\x86\x9a\xf8\x8f^}I6\xb4\xe8u0*\x1c0\x97\xcbW\x00\x0b\x00\x02\x01\x00\x00\n\x00\x16\x00\x14\x00\x17\x00\x18\x00\x19\x00\x1d\x00\x1e\x01\x00\x01\x01\x01\x02\x01\x03\x01\x04\x00-\x00\x03\x02\x01\x00\x00+\x00\t\x08\x03\x04\x03\x03\x03\x02\x03\x01\xff\x01\x00\x01\x00\x00#\x00\x00'
============ Debug ==========

I'll look into it if it's a new issue, but I would guess someone has seen this already!

Metadata

Metadata

Assignees

Labels

bugUnexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions