matrix-org / pantalaimon

E2EE aware proxy daemon for matrix clients.
Apache License 2.0
279 stars 41 forks source link

Can't login, always see aiohttp.http_exceptions.BadStatusLine error #147

Closed WurdahMekanik closed 1 year ago

WurdahMekanik commented 1 year ago

On every client I've tried I see this error when trying to login via panatlaimon (i.e. entering localhost:PORT or 127.0.0.1:PORT for my homeserver):

Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 332, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 551, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message="Bad status line 'Invalid method encountered'"

The clients I've tried are Element, Nheko, Fractal, and Neochat. I'm on Arch Linux, with Matrix Synapse server version 1.70.1 and python-aiohttp version 3.8.3

EDIT: this appears to be because panatlaimon requires that one login with http while every client tries to login with https instead... prepending http:// no longer shows the BadStatusLine error, but I still can't seem to login with panatlaimon.

Now I just see INFO: pantalaimon: New user logging in: USERNAME and the client fails to login completely with "unknown connection errors" The only clients I've tried that support login with http:// have been Element and Fractal.

WurdahMekanik commented 1 year ago

Ok, so my problem ultimately came down to not using exactly the same homeserver path when connecting with the client as what was set for ListeningAddress in pantalaimon.conf

e.g. using 127.0.0.1:PORT for the homeserver in the client, while having localhost in pantalaimon.conf causes comms to fail