pushtify icon indicating copy to clipboard operation
pushtify copied to clipboard

SSL: WRONG_VERSION_NUMBER

Open AntoVie opened this issue 1 year ago • 2 comments

I've installed pushtify with this :

  services:
    pushtify:
      image: ghcr.io/sebw/pushtify:latest
      container_name: pushtify
      environment:
        - GOTIFY_TOKEN=Ai_XXXXXXXX_
        - GOTIFY_HOST=192.168.2.221:8079
        - PUSHOVER_USERKEY=uzXXXXXXXh4
      restart: unless-stopped

The build goes well then in the container logs I got this message :

[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)
### closed ###

Do we need to use the ssl connection to Gotify ? Because I didn't enable it in Gotify.

Thanks

AntoVie avatar Jun 05 '24 14:06 AntoVie

Secure websocket is hard coded in the python code.

Replace wss:// with ws:// and rebuild the container image and you should be fine!

sebw avatar Jun 05 '24 17:06 sebw

For convenience, a working Dockerfile:

FROM python:3.10.7-alpine3.16

RUN pip install ntfy && \
    pip install websocket-client && \
    rm -rf /var/cache/*

ENV GOTIFY_TOKEN=xyz
ENV GOTIFY_HOST=ws://gotify.example.org
ENV PUSHOVER_USERKEY=abcdefghijklmnopqrstuvwxyz

COPY pushtify-listener.py /usr/local/bin

ENTRYPOINT ["python3","/usr/local/bin/pushtify-listener.py"]

Modified last block of pushtify-listener.py:

if __name__ == "__main__":
    wsapp = websocket.WebSocketApp(str(gotify_host) + "/stream", header={"X-Gotify-Key": str(gotify_token)},
                              on_open=on_open,
                              on_message=on_message,
                              on_error=on_error,
                              on_close=on_close)
    wsapp.run_forever()

ristomatti avatar Jun 24 '24 23:06 ristomatti

Implemented in 546d56b4f036a79e15d40309be6e198a595f6653

sebw avatar Dec 23 '24 19:12 sebw

@sebw Fix confirmed. 👍

ristomatti avatar Feb 23 '25 14:02 ristomatti