diff --git a/conf/glances.conf b/conf/glances.conf index 597ed4eb..8619de03 100644 --- a/conf/glances.conf +++ b/conf/glances.conf @@ -574,9 +574,11 @@ host=localhost port=5984 db=glances # user and password are optional (comment if not configured on the server side) +# If they are used, then the https protocol will be used #user=root #password=root + [kafka] # Configuration for the --export kafka option # http://kafka.apache.org/ diff --git a/glances/exports/glances_couchdb.py b/glances/exports/glances_couchdb.py index 07d2cbd2..8951cc19 100644 --- a/glances/exports/glances_couchdb.py +++ b/glances/exports/glances_couchdb.py @@ -50,7 +50,9 @@ class Export(GlancesExport): if self.user is None: server_uri = 'http://{}:{}/'.format(self.host, self.port) else: - server_uri = 'http://{}:{}@{}:{}/'.format(self.user, self.password, self.host, self.port) + # Force https if a login/password is provided + # Related to https://github.com/nicolargo/glances/issues/2124 + server_uri = 'https://{}:{}@{}:{}/'.format(self.user, self.password, self.host, self.port) try: s = couchdb.Server(server_uri) @@ -58,7 +60,7 @@ class Export(GlancesExport): logger.critical("Cannot connect to CouchDB server %s (%s)" % (server_uri, e)) sys.exit(2) else: - logger.info("Connected to the CouchDB server %s" % server_uri) + logger.info("Connected to the CouchDB server") try: s[self.db]