+ def remote_check_xmpp(self, context, host, port, name):
+ xmpp_open = ("<stream:stream xmlns='jabber:client' xmlns:stream='"
+ "http://etherx.jabber.org/streams' xmlns:tls='http://www.ietf.org/rfc/"
+ "rfc2595.txt' to='{0}' xml:lang='en' version='1.0'>" )
+ xmpp_starttls = "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>"
+
+ connection = create_connection((host, port))
+ connection.sendall(xmpp_open.format(name).encode('utf-8'))
+ response = connection.recv(4096).decode('utf-8')
+
+ if not '</stream:features>' in response:
+ connection.recv(4096)
+
+ connection.sendall(xmpp_starttls.encode('utf-8'))
+ connection.recv(4096)
+
+ connection = context.wrap_socket(connection, server_hostname=name)
+ connection.do_handshake()
+
+ cert = connection.getpeercert()
+ return self.check_cert(cert, host, port, name)
+
+ def remote_check_smtp(self, context, host, port, name):