简体   繁体   中英

Does the aiohttp Python library in Windows support HTTPS?

When I make an HTTPS request using the aiohttp library with asyncio and Python 3.4 in Windows 7, the request fails with a NotImplementedError in the _make_ssl_transport function in base_events.py as shown in the traceback.

On Windows, I use the ProactorEventLoop. I think you have to use that one to get asyncio to work. I tried the same request in a Debian 7 VM with a compiled version of Python 3.4, and the same request works. I don't use the ProactorEventLoop in Debian, just the default though.

Any ideas or workarounds? Or, should I give up with aiohttp HTTPS on Windows for now? I am not able to use Linux for this project, needs to be on Windows.

As jfs and OP observe,

  1. ProactorEventLoop is incompatible with SSL, and
  2. The default loop supports SSL on Windows. By extension aiohttp should also work with https on Windows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM