I get an error. What is the reason for this error? I try to catch data from the API with an async function and it comes to this error.
ClientConnectorCertificateError at /
Cannot connect to host swapi.dev:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)')]
async def index(request):
start_time = time.time()
url = 'https://swapi.dev/api/starships/9/'
async with aiohttp.ClientSession() as client:
task = asyncio.ensure_future(fetch(client, url))
results = await asyncio.gather(task)
total = time.time() - start_time
print(total)
return render(request, 'index.html', {'results':results })