blob: 54ea22146d07c4b4974a7dcfc2ffc15ad86d81b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
Metadata-Version: 1.1
Name: idna-ssl
Version: 1.1.0
Summary: Patch ssl.match_hostname for Unicode(idna) domains support
Home-page: https://github.com/aio-libs/idna-ssl
Author: Victor Kovtun
Author-email: hellysmile@gmail.com
License: UNKNOWN
Description: idna-ssl
========
:info: Patch ssl.match_hostname for Unicode(idna) domains support
.. image:: https://travis-ci.com/aio-libs/idna-ssl.svg?branch=master
:target: https://travis-ci.com/aio-libs/idna-ssl
.. image:: https://img.shields.io/pypi/v/idna_ssl.svg
:target: https://pypi.python.org/pypi/idna_ssl
.. image:: https://codecov.io/gh/aio-libs/idna-ssl/branch/master/graph/badge.svg
:target: https://codecov.io/gh/aio-libs/idna-ssl
Installation
------------
.. code-block:: shell
pip install idna-ssl
Usage
-----
.. code-block:: python
from idna_ssl import patch_match_hostname # noqa isort:skip
patch_match_hostname() # noqa isort:skip
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())
Motivation
----------
* Here is 100% backward capability
* Related aiohttp `issue <https://github.com/aio-libs/aiohttp/issues/949>`_
* Related Python `bug <https://bugs.python.org/issue31872>`_
* Related Python `pull request <https://github.com/python/cpython/pull/3462>`_
* It is fixed (by January 27 2018) in upcoming Python 3.7, but `IDNA2008 <https://tools.ietf.org/html/rfc5895>`_ is still broken
Thanks
------
The library was donated by `Ocean S.A. <https://ocean.io/>`_
Thanks to the company for contribution.
Keywords: ssl,Unicode,idna,match_hostname
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
|