]> git.pld-linux.org Git - packages/nagios-alert-jabber.git/commitdiff
- add ssl support
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 30 Oct 2006 11:57:31 +0000 (11:57 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    nagios-jabber.alert -> 1.3

nagios-jabber.alert

index dd2e993bf13a2fbf04405dd8db1f81eb5ad2b745..1bec2d2b44298768e52c1f1df9e03b4f8b47c444 100644 (file)
@@ -1,6 +1,7 @@
 #!/usr/bin/python -u
 # arekm@pld-linux.org, 2006-01
 # glen@pld-linux.org, 2006-03-14
+# glen@pld-linux.org,arekm@pld-linux.org, 2006-10-30 - added ssl support (for gmail.com)
 # usage:
 #   jabber.alert -J from_jid -P password to_jid1 to_jid2 to_jid3
 
@@ -14,6 +15,7 @@ import time
 from pyxmpp.jid import JID
 from pyxmpp.message import Message
 from pyxmpp.jabber.client import JabberClient
+from pyxmpp.streamtls import TLSSettings
 
 try:
        opts, args = getopt.getopt(sys.argv[1:], "J:P:")
@@ -66,7 +68,8 @@ class Client(JabberClient):
                        msg = Message(to_jid = jid_r, body = body, subject = subject, stanza_type = message_type)
                        self.stream.send(msg)
                self.disconnect()
-c = Client(jid, password, server = server, port = port)
+
+c = Client(jid, password, server = server, port = port, auth_methods = ['sasl:PLAIN'], tls_settings = TLSSettings(require = True, verify_peer = False))
 c.connect()
 try:
        c.loop(1)
This page took 0.13652 seconds and 4 git commands to generate.