File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from ssl import PROTOCOL_TLS_CLIENT
2+
13from httpx import Client , Response
4+ from truststore import SSLContext
25
36from backend .config import config , \
47 TIMEOUT
58from backend .helpers import log
69
710# disable TLS verification if configured
811if config .api .get ('verify' , True ) == False :
9- gitlab_session = Client ( follow_redirects = True , verify = False )
12+ verify = False
1013else :
11- gitlab_session = Client (follow_redirects = True )
14+ # use system trust store for TLS verification
15+ verify = SSLContext (PROTOCOL_TLS_CLIENT )
16+ gitlab_session = Client (follow_redirects = True , verify = verify )
1217
18+ # add GitLab API token to session headers
19+ # this is needed for all requests to the GitLab API
1320gitlab_session .headers .update ({'PRIVATE-TOKEN' : config .api .token })
1421
1522
Original file line number Diff line number Diff line change 77munch
88pyaml
99python-dateutil
10+ truststore
You can’t perform that action at this time.
0 commit comments