'CouchDB connection setup for proxying'

def __config_couchdb_conn(self):

    self.__couchdb_host = server.config.couchdb.host
    if self.__ssl_enabled:
        self.__couchdb_port = int(server.config.couchdb.ssl_port)
        ssl_context = self.__load_ssl_certs()
        self.__listen_func = functools.partial(reactor.listenSSL, contextFactory=ssl_context)
    else:
        self.__couchdb_port = int(server.config.couchdb.port)
        self.__listen_func = reactor.listenTCP
