From 82dd30160fdbbd66d696149c804290408309cb22 Mon Sep 17 00:00:00 2001 From: Jose Javier Merchante Date: Thu, 9 Feb 2023 12:36:20 +0100 Subject: [PATCH] [sortinghat] Include db_verify_ssl option for SortingHat This commit includes a new method in the enrichment process to verify the connection to the SortingHat database when using SSL. Signed-off-by: Jose Javier Merchante --- grimoire_elk/elk.py | 5 +++-- grimoire_elk/enriched/cocom.py | 4 ++-- grimoire_elk/enriched/colic.py | 4 ++-- grimoire_elk/enriched/discourse.py | 4 ++-- grimoire_elk/enriched/dockerdeps.py | 4 ++-- grimoire_elk/enriched/dockersmells.py | 4 ++-- grimoire_elk/enriched/enrich.py | 3 ++- grimoire_elk/enriched/gerrit.py | 4 ++-- grimoire_elk/enriched/git.py | 4 ++-- grimoire_elk/enriched/github.py | 4 ++-- grimoire_elk/enriched/github2.py | 4 ++-- grimoire_elk/enriched/githubql.py | 4 ++-- grimoire_elk/enriched/gitlab.py | 4 ++-- grimoire_elk/enriched/gitter.py | 4 ++-- grimoire_elk/enriched/jenkins.py | 4 ++-- grimoire_elk/enriched/launchpad.py | 4 ++-- grimoire_elk/enriched/mattermost.py | 4 ++-- grimoire_elk/enriched/mbox.py | 4 ++-- grimoire_elk/enriched/pagure.py | 4 ++-- grimoire_elk/enriched/phabricator.py | 4 ++-- grimoire_elk/enriched/remo.py | 4 ++-- grimoire_elk/enriched/weblate.py | 4 ++-- tests/base.py | 19 +++++++++++++------ tests/test_sortinghat_gelk.py | 4 +++- 24 files changed, 61 insertions(+), 50 deletions(-) diff --git a/grimoire_elk/elk.py b/grimoire_elk/elk.py index 762db663b..fa4ffa615 100755 --- a/grimoire_elk/elk.py +++ b/grimoire_elk/elk.py @@ -490,7 +490,7 @@ def enrich_backend(url, clean, backend_name, backend_params, cfg_section_name, github_token=None, studies=False, only_studies=False, url_enrich=None, events_enrich=False, db_user=None, db_password=None, db_host=None, - db_port=None, db_path=None, db_ssl=False, + db_port=None, db_path=None, db_ssl=False, db_verify_ssl=True, do_refresh_projects=False, do_refresh_identities=False, author_id=None, author_uuid=None, filter_raw=None, jenkins_rename_file=None, @@ -538,7 +538,8 @@ def enrich_backend(url, clean, backend_name, backend_params, cfg_section_name, db_host=db_host, db_port=db_port, db_path=db_path, - db_ssl=db_ssl) + db_ssl=db_ssl, + db_verify_ssl=db_verify_ssl) enrich_backend.set_params(backend_params) # store the cfg section name in the enrich backend to recover the corresponding project name in projects.json enrich_backend.set_cfg_section_name(cfg_section_name) diff --git a/grimoire_elk/enriched/cocom.py b/grimoire_elk/enriched/cocom.py index be2b80c19..412d66203 100644 --- a/grimoire_elk/enriched/cocom.py +++ b/grimoire_elk/enriched/cocom.py @@ -150,10 +150,10 @@ class CocomEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.studies = [] self.studies.append(self.enrich_cocom_analysis) diff --git a/grimoire_elk/enriched/colic.py b/grimoire_elk/enriched/colic.py index f9d1447b3..ac142f825 100644 --- a/grimoire_elk/enriched/colic.py +++ b/grimoire_elk/enriched/colic.py @@ -86,10 +86,10 @@ class ColicEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.studies = [] self.studies.append(self.enrich_colic_analysis) diff --git a/grimoire_elk/enriched/discourse.py b/grimoire_elk/enriched/discourse.py index cb75c5cd3..bdb9639dd 100644 --- a/grimoire_elk/enriched/discourse.py +++ b/grimoire_elk/enriched/discourse.py @@ -64,10 +64,10 @@ class DiscourseEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.categories = {} # Map from category_id to category_name self.categories_tree = {} # Categories with subcategories diff --git a/grimoire_elk/enriched/dockerdeps.py b/grimoire_elk/enriched/dockerdeps.py index 12c677e8f..94d73bf92 100644 --- a/grimoire_elk/enriched/dockerdeps.py +++ b/grimoire_elk/enriched/dockerdeps.py @@ -74,10 +74,10 @@ class Dockerdeps(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.studies = [] diff --git a/grimoire_elk/enriched/dockersmells.py b/grimoire_elk/enriched/dockersmells.py index 5b10257f7..45b71c565 100644 --- a/grimoire_elk/enriched/dockersmells.py +++ b/grimoire_elk/enriched/dockersmells.py @@ -74,10 +74,10 @@ class Dockersmells(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.studies = [] diff --git a/grimoire_elk/enriched/enrich.py b/grimoire_elk/enriched/enrich.py index f317d373d..3b2853495 100644 --- a/grimoire_elk/enriched/enrich.py +++ b/grimoire_elk/enriched/enrich.py @@ -117,7 +117,7 @@ class Enrich(ElasticItems): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', insecure=True, db_port=None, db_path=None, - db_ssl=False): + db_ssl=False, db_verify_ssl=True): perceval_backend = None super().__init__(perceval_backend, insecure=insecure) @@ -131,6 +131,7 @@ def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', if not Enrich.sh_db: client = SortingHatClient(host=db_host, port=db_port, path=db_path, ssl=db_ssl, + verify_ssl=db_verify_ssl, user=db_user, password=db_password) client.connect() client.gqlc.logger.setLevel(logging.CRITICAL) diff --git a/grimoire_elk/enriched/gerrit.py b/grimoire_elk/enriched/gerrit.py index 8985c645b..753fa9e76 100644 --- a/grimoire_elk/enriched/gerrit.py +++ b/grimoire_elk/enriched/gerrit.py @@ -89,10 +89,10 @@ class GerritEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.studies = [] self.studies.append(self.enrich_demography) diff --git a/grimoire_elk/enriched/git.py b/grimoire_elk/enriched/git.py index e8bc0e031..fd461b82b 100644 --- a/grimoire_elk/enriched/git.py +++ b/grimoire_elk/enriched/git.py @@ -94,10 +94,10 @@ class GitEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False, pair_programming=False): + db_port=None, db_ssl=False, db_verify_ssl=True, pair_programming=False): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.studies = [] self.studies.append(self.enrich_demography) diff --git a/grimoire_elk/enriched/github.py b/grimoire_elk/enriched/github.py index 326e60208..fc334628c 100644 --- a/grimoire_elk/enriched/github.py +++ b/grimoire_elk/enriched/github.py @@ -106,10 +106,10 @@ class GitHubEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.studies = [] self.studies.append(self.enrich_onion) diff --git a/grimoire_elk/enriched/github2.py b/grimoire_elk/enriched/github2.py index 2222ed017..c9400b2c0 100644 --- a/grimoire_elk/enriched/github2.py +++ b/grimoire_elk/enriched/github2.py @@ -107,10 +107,10 @@ class GitHubEnrich2(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.studies = [] self.studies.append(self.enrich_geolocation) diff --git a/grimoire_elk/enriched/githubql.py b/grimoire_elk/enriched/githubql.py index bb77d8aba..63399e75c 100644 --- a/grimoire_elk/enriched/githubql.py +++ b/grimoire_elk/enriched/githubql.py @@ -78,10 +78,10 @@ class GitHubQLEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.studies = [self.enrich_duration_analysis, self.enrich_reference_analysis] diff --git a/grimoire_elk/enriched/gitlab.py b/grimoire_elk/enriched/gitlab.py index 2eee7f22a..f59f017ce 100644 --- a/grimoire_elk/enriched/gitlab.py +++ b/grimoire_elk/enriched/gitlab.py @@ -76,10 +76,10 @@ class GitLabEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.users = {} # cache users self.studies = [] diff --git a/grimoire_elk/enriched/gitter.py b/grimoire_elk/enriched/gitter.py index e526cf6fa..f45f9127d 100644 --- a/grimoire_elk/enriched/gitter.py +++ b/grimoire_elk/enriched/gitter.py @@ -65,10 +65,10 @@ class GitterEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) def get_field_author(self): return "fromUser" diff --git a/grimoire_elk/enriched/jenkins.py b/grimoire_elk/enriched/jenkins.py index a662f96c5..be90695dd 100644 --- a/grimoire_elk/enriched/jenkins.py +++ b/grimoire_elk/enriched/jenkins.py @@ -61,10 +61,10 @@ class JenkinsEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False, node_regex=None): + db_port=None, db_ssl=False, db_verify_ssl=True, node_regex=None): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.nodes_rename_file = None self.nodes_rename = {} self.node_regex = node_regex diff --git a/grimoire_elk/enriched/launchpad.py b/grimoire_elk/enriched/launchpad.py index 4c58f12c3..151b7e646 100644 --- a/grimoire_elk/enriched/launchpad.py +++ b/grimoire_elk/enriched/launchpad.py @@ -63,10 +63,10 @@ class LaunchpadEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) def get_field_author(self): return "owner_data" diff --git a/grimoire_elk/enriched/mattermost.py b/grimoire_elk/enriched/mattermost.py index c92c0385f..3c5cf8bdc 100644 --- a/grimoire_elk/enriched/mattermost.py +++ b/grimoire_elk/enriched/mattermost.py @@ -60,10 +60,10 @@ class MattermostEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.studies = [] self.studies.append(self.enrich_demography) diff --git a/grimoire_elk/enriched/mbox.py b/grimoire_elk/enriched/mbox.py index b1afedfa3..702bf748d 100644 --- a/grimoire_elk/enriched/mbox.py +++ b/grimoire_elk/enriched/mbox.py @@ -67,10 +67,10 @@ class MBoxEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.studies = [self.kafka_kip] diff --git a/grimoire_elk/enriched/pagure.py b/grimoire_elk/enriched/pagure.py index 372c74c44..b7115f1b0 100644 --- a/grimoire_elk/enriched/pagure.py +++ b/grimoire_elk/enriched/pagure.py @@ -74,10 +74,10 @@ class PagureEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) def set_elastic(self, elastic): self.elastic = elastic diff --git a/grimoire_elk/enriched/phabricator.py b/grimoire_elk/enriched/phabricator.py index d6e7ecb46..2c33a0fe3 100644 --- a/grimoire_elk/enriched/phabricator.py +++ b/grimoire_elk/enriched/phabricator.py @@ -77,10 +77,10 @@ class PhabricatorEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.phab_ids_names = {} # To convert from phab ids to phab names diff --git a/grimoire_elk/enriched/remo.py b/grimoire_elk/enriched/remo.py index 4923aa043..c76dbe2c2 100644 --- a/grimoire_elk/enriched/remo.py +++ b/grimoire_elk/enriched/remo.py @@ -60,10 +60,10 @@ class ReMoEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.author = "user" # changes if we are generating events def get_field_author(self): diff --git a/grimoire_elk/enriched/weblate.py b/grimoire_elk/enriched/weblate.py index c8d85c576..91efd832a 100644 --- a/grimoire_elk/enriched/weblate.py +++ b/grimoire_elk/enriched/weblate.py @@ -61,10 +61,10 @@ class WeblateEnrich(Enrich): def __init__(self, db_sortinghat=None, json_projects_map=None, db_user='', db_password='', db_host='', db_path=None, - db_port=None, db_ssl=False): + db_port=None, db_ssl=False, db_verify_ssl=True): super().__init__(db_sortinghat=db_sortinghat, json_projects_map=json_projects_map, db_user=db_user, db_password=db_password, db_host=db_host, - db_port=db_port, db_path=db_path, db_ssl=db_ssl) + db_port=db_port, db_path=db_path, db_ssl=db_ssl, db_verify_ssl=db_verify_ssl) self.studies = [] self.studies.append(self.enrich_demography) diff --git a/tests/base.py b/tests/base.py index 239bd9c7c..1fbc6cc79 100644 --- a/tests/base.py +++ b/tests/base.py @@ -132,6 +132,7 @@ def setUpClass(cls): cls.db_port = cls.config.get('Database', 'port', fallback=None) cls.db_path = cls.config.get('Database', 'path', fallback=None) cls.db_ssl = cls.config.getboolean('Database', 'ssl', fallback=False) + cls.db_verify_ssl = cls.config.getboolean('Database', 'verify_ssl', fallback=True) def setUp(self): with open(os.path.join("data", self.connector + ".json")) as f: @@ -180,7 +181,8 @@ def _test_raw_to_enrich(self, sortinghat=False, projects=False, pair_programming db_host=self.db_host, db_port=self.db_port, db_path=self.db_path, - db_ssl=self.db_ssl) + db_ssl=self.db_ssl, + db_verify_ssl=self.db_verify_ssl) elif sortinghat and projects: self.enrich_backend = self.connectors[self.connector][2](json_projects_map=FILE_PROJECTS, db_sortinghat=DB_SORTINGHAT, @@ -189,7 +191,8 @@ def _test_raw_to_enrich(self, sortinghat=False, projects=False, pair_programming db_host=self.db_host, db_port=self.db_port, db_path=self.db_path, - db_ssl=self.db_ssl) + db_ssl=self.db_ssl, + db_verify_ssl=self.db_verify_ssl) elif not sortinghat and projects: self.enrich_backend = self.connectors[self.connector][2](json_projects_map=FILE_PROJECTS, @@ -198,7 +201,8 @@ def _test_raw_to_enrich(self, sortinghat=False, projects=False, pair_programming db_host=self.db_host, db_port=self.db_port, db_path=self.db_path, - db_ssl=self.db_ssl) + db_ssl=self.db_ssl, + db_verify_ssl=self.db_verify_ssl) if pair_programming: self.enrich_backend.pair_programming = pair_programming @@ -252,7 +256,8 @@ def _test_refresh_identities(self): db_host=self.db_host, db_port=self.db_port, db_path=self.db_path, - db_ssl=self.db_ssl) + db_ssl=self.db_ssl, + db_verify_ssl=self.db_verify_ssl) elastic_enrich = get_elastic(self.es_con, self.enrich_index, clean, self.enrich_backend) self.enrich_backend.set_elastic(elastic_enrich) self.enrich_backend.enrich_items(self.ocean_backend) @@ -279,7 +284,8 @@ def _test_study(self, test_study, projects_json_repo=None, projects_json=None, p db_host=self.db_host, db_port=self.db_port, db_path=self.db_path, - db_ssl=self.db_ssl) + db_ssl=self.db_ssl, + db_verify_ssl=self.db_verify_ssl) elastic_enrich = get_elastic(self.es_con, self.enrich_index, clean, self.enrich_backend) self.enrich_backend.set_elastic(elastic_enrich) @@ -332,7 +338,8 @@ def _test_raw_to_enrich_anonymized(self, sortinghat=False, projects=False): db_host=self.db_host, db_port=self.db_port, db_path=self.db_path, - db_ssl=self.db_ssl) + db_ssl=self.db_ssl, + db_verify_ssl=self.db_verify_ssl) elastic_enrich = get_elastic(self.es_con, self.enrich_index_anonymized, clean, self.enrich_backend, self.enrich_aliases) self.enrich_backend.set_elastic(elastic_enrich) diff --git a/tests/test_sortinghat_gelk.py b/tests/test_sortinghat_gelk.py index 950d1f558..cae184133 100644 --- a/tests/test_sortinghat_gelk.py +++ b/tests/test_sortinghat_gelk.py @@ -103,13 +103,15 @@ def setUp(self): db_port = config.get('Database', 'port', fallback=None) db_path = config.get('Database', 'path', fallback=None) db_ssl = config.getboolean('Database', 'ssl', fallback=False) + db_verify_ssl = config.getboolean('Database', 'verify_ssl', fallback=True) self.sh_db = SortingHatClient(host=db_host, port=db_port, user=db_user, password=db_password, path=db_path, - ssl=db_ssl) + ssl=db_ssl, + verify_ssl=db_verify_ssl) self.sh_db.connect() # Clean database # Remove identities