gjedeer / xmpp-youtube-dl-bot

Download youtube videos and MP3s over XMPP
GNU General Public License v3.0
5 stars 3 forks source link

Connecting to TLS Port not working #2

Open Dominion0815 opened 4 years ago

Dominion0815 commented 4 years ago

Hi,

I'm using blabber.im account. The server has several SRV records and from time to time BOT can't connect. Is it possible to ignore TLS port 443 or to set a fix hostname with port 5222 ?

Here is the error message:

Invalid debugflag given: always
Invalid debugflag given: nodebuilder
DEBUG:
DEBUG: Debug created for /usr/lib/python2.7/dist-packages/xmpp/client.py
DEBUG:  flags defined: always,nodebuilder
DEBUG: socket       start Plugging <xmpp.transports.TCPsocket instance at 0x7f47a7d1d5f0> into <xmpp.client.Client instance at 0x7f47a7d1d518>
DEBUG: socket       start Successfully connected to remote host ('erebos.xmpp.blabber.im.', 443)
DEBUG: tls          start Plugging <xmpp.transports.TLS instance at 0x7f47a7d1d638> into <xmpp.client.Client instance at 0x7f47a7d1d518>
Traceback (most recent call last):
  File "bot.py", line 232, in <module>
    cl.connect(proxy=settings.proxy)
  File "/usr/lib/python2.7/dist-packages/xmpp/client.py", line 200, in connect
    if not CommonClient.connect(self,server,proxy,secure,use_srv) or secure<>None and not secure: return self.connected
  File "/usr/lib/python2.7/dist-packages/xmpp/client.py", line 178, in connect
    transports.TLS().PlugIn(self,now=1)
  File "/usr/lib/python2.7/dist-packages/xmpp/transports.py", line 274, in PlugIn
    if now: return self._startSSL()
  File "/usr/lib/python2.7/dist-packages/xmpp/transports.py", line 308, in _startSSL
    tcpsock._sslObj    = ssl.wrap_socket(tcpsock._sock, None, None)
  File "/usr/lib/python2.7/ssl.py", line 931, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 599, in __init__
    self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 828, in do_handshake
    self._sslobj.do_handshake()
socket.error: [Errno 0] Error

Best regards Dominion

gjedeer commented 4 years ago

Do you know any Python?

It should be possible to do

cl.Connect(server=('xmpp.blabber.im', 5222), use_srv=False, proxy=settings.proxy)

in bot.py:232, if you succeed with this then a patch to turn it into a setting would be welcome.

Dominion0815 commented 4 years ago

no python knowledge here ;) It works, thanks!

It would be good if this would be added to the settings.

gjedeer commented 4 years ago

Hey, I'm glad it worked. Will add to settings when I have more time. Thanks for testing!