Skip to content

Commit 65ba246

Browse files
committed
Add 'insecure' config option to allow self signed certs
If connecting to a GitLab instance which uses a self signed certificate, the connection would fail. This option allows for a workaround to disable verification at all.
1 parent 0ffa4b5 commit 65ba246

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

git_repo/services/ext/gitlab.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class GitlabService(RepositoryService):
1616
fqdn = 'gitlab.com'
1717

1818
def __init__(self, *args, **kwarg):
19-
self.gl = gitlab.Gitlab(self.url_ro)
20-
super(GitlabService, self).__init__(*args, **kwarg)
19+
super().__init__(*args, **kwarg)
20+
self.gl = gitlab.Gitlab(self.url_ro, ssl_verify=not self.insecure)
2121

2222
def connect(self):
2323
self.gl.set_url(self.url_ro)

git_repo/services/service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def __init__(self, r=None, c=None):
156156
c.get('privatekey', None))))
157157
self._alias = c.get('alias', self.name)
158158
self.fqdn = c.get('fqdn', self.fqdn)
159+
self.insecure = c.get('insecure', False)
159160

160161
# if service has a repository configured, connect
161162
if r:

0 commit comments

Comments
 (0)