def _bind(self, family, type, proto=0):
        """Create (or recreate) the actual socket object."""
        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.")
            
            # See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442473
            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, 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 listening on the IPV6 any address ('::' = IN6ADDR_ANY),
            # activate dual-stack. See http://www.cherrypy.org/ticket/871.
            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 (__HOLE__, socket.error):
                    # Apparently, the socket option is not available in
                    # this machine's TCP stack
                    pass
        
        self.socket.bind(self.bind_addr)
dataset/ETHPy150Open cloudera/hue/desktop/core/src/desktop/lib/wsgiserver.py/CherryPyWSGIServer._bind