Skip to content

Commit

Permalink
Merge pull request #27 from GDATASoftwareAG/ssl-verification
Browse files Browse the repository at this point in the history
Allow turning SSL verification off for upload
  • Loading branch information
doxthree authored May 24, 2022
2 parents db7686c + 819b5e1 commit b6481dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/src/vaas/vaas.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, tracing=VaasTracing()):
self.results = {}
self.httpx_client = httpx.AsyncClient(http2=True)

async def connect(self, token, url=URL):
async def connect(self, token, url=URL, verify=True):
"""Connect to VaaS
token -- OpenID Connect token signed by a trusted identity provider
Expand All @@ -56,6 +56,8 @@ async def connect(self, token, url=URL):
self.__receive_loop()
) # fire and forget async_foo()

self.httpx_client = httpx.AsyncClient(http2=True, verify=verify)

async def connect_with_client_credentials(
self, client_id, client_secret, token_endpoint, url=URL, verify=True
):
Expand All @@ -70,7 +72,7 @@ async def connect_with_client_credentials(
"""
async with AsyncOAuth2Client(client_id, client_secret, verify=verify) as client:
token = (await client.fetch_token(token_endpoint))["access_token"]
await self.connect(token, url)
await self.connect(token, url, verify)

async def close(self):
"""Close the connection"""
Expand Down

0 comments on commit b6481dd

Please sign in to comment.