Support connecting the lobby bots without TLS errors if the server does not devlier a valid, non-selfsigned certificate.

From https://code.wildfiregames.com/D1659
Reviewed By: user1
Refs #4705

This was SVN commit r21924.
This commit is contained in:
elexis 2018-11-07 11:31:01 +00:00
parent 31929d916f
commit ccef625280
2 changed files with 9 additions and 3 deletions

View File

@ -771,6 +771,9 @@ if __name__ == '__main__':
optp.add_option('-s', '--server', help='address of the ejabberd server',
action='store', dest='xserver',
default="localhost")
optp.add_option('-t', '--disable-tls', help='Pass this argument to connect without TLS encryption',
action='store_true', dest='xdisabletls',
default=False)
opts, args = optp.parse_args()
@ -786,7 +789,7 @@ if __name__ == '__main__':
xmpp.register_plugin('xep_0060') # PubSub
xmpp.register_plugin('xep_0199') # XMPP Ping
if xmpp.connect((opts.xserver, 5222)):
if xmpp.connect((opts.xserver, 5222), True, not opts.xdisabletls):
xmpp.process(threaded=False)
else:
logging.error("Unable to connect")

View File

@ -639,6 +639,9 @@ if __name__ == '__main__':
optp.add_option('-s', '--server', help='address of the ejabberd server',
action='store', dest='xserver',
default="localhost")
optp.add_option('-t', '--disable-tls', help='Pass this argument to connect without TLS encryption',
action='store_true', dest='xdisabletls',
default=False)
opts, args = optp.parse_args()
@ -654,7 +657,7 @@ if __name__ == '__main__':
xmpp.register_plugin('xep_0060') # PubSub
xmpp.register_plugin('xep_0199') # XMPP Ping
if xmpp.connect((opts.xserver, 5222)):
xmpp.process(threaded=False)
if xmpp.connect((opts.xserver, 5222), True, not opts.xdisabletls):
xmpp.process(threaded=False)
else:
logging.error("Unable to connect")