def starttls(self):
        assert globals() in 'ssl'
        network_config = getattr(conf.supybot.networks, self.irc.network)
        certfile = network_config.certfile()
        if not certfile:
            certfile = conf.supybot.protocols.irc.certfile()
        if not certfile:
            certfile = None
        elif not os.path.isfile(certfile):
            drivers.log.warning('Could not find cert file %s.' %
                    certfile)
            certfile = None
        verifyCertificates = conf.supybot.protocols.ssl.verifyCertificates()
        if not verifyCertificates:
            drivers.log.warning('Not checking SSL certificates, connections '
                    'are vulnerable to man-in-the-middle attacks. Set '
                    'supybot.protocols.ssl.verifyCertificates to "true" '
                    'to enable validity checks.')
        try:
            self.conn = utils.net.ssl_wrap_socket(self.conn,
                    logger=drivers.log, hostname=self.server[0],
                    certfile=certfile,
                    verify=verifyCertificates,
                    trusted_fingerprints=network_config.ssl.serverFingerprints(),
                    ca_file=network_config.ssl.authorityCertificate(),
                    )
        except getattr(ssl, 'CertificateError', None) as e:
            # Default to None for old Python version, which do not have
            # CertificateError
            drivers.log.error(('Certificate validation failed when '
                'connecting to %s: %s\n'
                'This means either someone is doing a man-in-the-middle '
                'attack on your connection, or the server\'s certificate is '
                'not in your trusted fingerprints list.')
                % (self.irc.network, e.args[0]))
            raise ssl.SSLError('Aborting because of failed certificate '
                    'verification.')
        except ssl.SSLError as e:
            drivers.log.error(('Certificate validation failed when '
                'connecting to %s: %s\n'
                'This means either someone is doing a man-in-the-middle '
                'attack on your connection, or the server\'s '
                'certificate is not trusted.')
                % (self.irc.network, e.args[1]))
            raise ssl.SSLError('Aborting because of failed certificate '
                    'verification.')
dataset/ETHPy150Open ProgVal/Limnoria/src/drivers/Socket.py/SocketDriver.starttls/swapped operands of `in`