Skip to content

Auto patch ssl for Python 3.7- #2674

Closed
Closed
@hellysmile

Description

Long story short

Proposal to fix #949

There is an idea discussed with @asvetlov offline: automatically patch Python runtime by https://github.com/aio-libs/idna_ssl if Python version is lower then 3.7

Expected behaviour

ssl.CertificateError works correct for idna hosts

Actual behaviour

ssl.CertificateError is raised

Steps to reproduce

import asyncio

import aiohttp

URL = 'https://цфоут.мвд.рф/news/item/8065038/'


async def main():
    async with aiohttp.ClientSession() as session:
        async with session.get(URL) as response:
            print(response)


loop = asyncio.get_event_loop()
loop.run_until_complete(main())

Your environment

aiohttp server master
Python 3.6.2

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions