'Prepare the server for HTTPS.
Make sure that the ssl_module is loaded and that the server
is appropriately listening on port.
:param str port: Port to listen on'

def prepare_server_https(self, port, temp=False):

    if (port != '443'):
        port_service = ('%s    %s' % (port, 'https'))
    else:
        port_service = port
    self.prepare_https_modules(temp)
    listens = [self.parser.get_arg(x).split()[0] for x in self.parser.find_dir('Listen')]
    if (not listens):
        listens = ['80']
    if self._has_port_already(listens, port):
        return
    listen_dirs = set(listens)
    for listen in listens:
        if (len(listen.split(':')) == 1):
            if ((port not in listen_dirs) and (port_service not in listen_dirs)):
                listen_dirs.add(port_service)
        else:
            (_, ip) = listen[::(-1)].split(':', 1)
            ip = ip[::(-1)]
            if ((('%s:%s' % (ip, port_service)) not in listen_dirs) and (('%s:%s' % (ip, port_service)) not in listen_dirs)):
                listen_dirs.add(('%s:%s' % (ip, port_service)))
    self._add_listens(listen_dirs, listens, port)
