'ZNC is accepting encrypted logins'

def test_irc_auth(self):

    import ssl
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    ssl_sock = ssl.wrap_socket(s, ca_certs=CA_BUNDLE, cert_reqs=ssl.CERT_REQUIRED)
    ssl_sock.connect((TEST_SERVER, 6697))
    (cipher, version, bits) = ssl_sock.cipher()
    self.assertEquals(cipher, 'AES256-GCM-SHA384')
    self.assertEquals(version, 'TLSv1/SSLv3')
    self.assertEquals(bits, 256)
    ssl_sock.send('CAP    REQ    sasl    multi-prefix\r\n')
    ssl_sock.send('PASS    foo\r\n')
    ssl_sock.send('NICK    sovereign\r\n')
    ssl_sock.send('USER    sovereign    0    *    Sov\r\n')
    while 1:
        r = ssl_sock.recv(1024)
        if ('Connected    to    ZNC' in r):
            break
