'Create (or recreate) the actual socket object.'

def _bind(self, family, type, proto=0):

    self.socket = socket.socket(family, type, proto)
    prevent_socket_inheritance(self.socket)
    self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    if self.nodelay:
        self.socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
    if (self.ssl_certificate and self.ssl_private_key):
        if (SSL is None):
            raise ImportError('You    must    install    pyOpenSSL    to    use    HTTPS.')
        ctx = SSL.Context(SSL.SSLv23_METHOD)
        if (self.ssl_password_cb is not None):
            ctx.set_passwd_cb(self.ssl_password_cb)
        ctx.set_cipher_list(self.ssl_cipher_list)
        try:
            ctx.use_privatekey_file(self.ssl_private_key)
            ctx.use_certificate_file(self.ssl_certificate)
            if self.ssl_certificate_chain:
                ctx.use_certificate_chain_file(self.ssl_certificate_chain)
        except Exception as ex:
            logging.exception('SSL    key    and    certificate    could    not    be    found    or    have    a    problem')
            raise ex
        ctx.set_options((SSL.OP_NO_SSLv2 | SSL.OP_NO_SSLv3))
        self.socket = SSLConnection(ctx, self.socket)
        self.populate_ssl_environ()
        if ((not isinstance(self.bind_addr, basestring)) and (self.bind_addr[0] == '::') and (family == socket.AF_INET6)):
            try:
                self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
            except (AttributeError, socket.error):
                pass
    self.socket.bind(self.bind_addr)
