Skip to content

Commit ceb7aa1

Browse files
committed
[+] add codecov cacerts
1 parent f191dad commit ceb7aa1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

codecov/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
pass
3131

3232

33-
version = VERSION = __version__ = '1.5.2'
33+
version = VERSION = __version__ = '1.6.0'
3434

3535
COLOR = True
3636

@@ -228,6 +228,7 @@ def main(*argv, **kwargs):
228228
enterprise = parser.add_argument_group('======================== Enterprise ========================')
229229
enterprise.add_argument('--slug', '-r', default=os.getenv("CODECOV_SLUG"), help="Specify repository slug for Enterprise ex. owner/repo")
230230
enterprise.add_argument('--url', '-u', default=os.getenv("CODECOV_URL", "https://codecov.io"), help="Your Codecov endpoint")
231+
enterprise.add_argument('--cacert', default=os.getenv("CODECOV_CACERT", os.getenv("CURL_CA_BUNDLE")), help="Certificate pem bundle used to verify with your Codecov instance")
231232

232233
debugging = parser.add_argument_group('======================== Debugging ========================')
233234
debugging.add_argument('--dump', action="store_true", help="Dump collected data and do not send to Codecov")
@@ -586,6 +587,7 @@ def main(*argv, **kwargs):
586587
try:
587588
write(' Pinging Codecov...')
588589
res = requests.post('%s/upload/v3?%s' % (codecov.url, urlargs),
590+
verify=codecov.cacert,
589591
headers={'Accept': 'text/plain'})
590592
if res.status_code in (400, 406):
591593
raise Exception(res.text)
@@ -609,6 +611,7 @@ def main(*argv, **kwargs):
609611
write(' Uploading to Codecov...')
610612
# just incase, try traditional upload
611613
res = requests.post('%s/upload/v2?%s' % (codecov.url, urlargs),
614+
verify=codecov.cacert,
612615
data='\n'.join((reports, s3.reason if s3 else '', s3.text if s3 else '')),
613616
headers={"Accept": "text/plain"})
614617
if res.status_code < 500:

0 commit comments

Comments
 (0)