File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -346,6 +346,32 @@ Most widly used is :class:`aiohttp.connector.TCPConnector`::
346
346
>>> r = yield from aiohttp.request('get', 'http://python.org', connector=conn)
347
347
348
348
349
+ SSL control for tcp sockets
350
+ ---------------------------
351
+
352
+ :class: `aiohttp.connector.TCPConnector ` constructor accepts mutually
353
+ exclusive *verify_ssl * and *ssl_context * params.
354
+
355
+ By default it uses strict checks for HTTPS protocol. Certification
356
+ checks can be relaxed by passing ``verify_ssl=False ``::
357
+
358
+ >>> conn = aiohttp.TCPConnector(verify_ssl=False)
359
+ >>> r = yield from aiohttp.request('get',
360
+ ... 'https://example.com', connector=conn)
361
+
362
+
363
+ If you need to setup custom ssl parameters (use own certification
364
+ files for example) you can create :class: `ssl.SSLContext ` instance and
365
+ pass it into connector::
366
+
367
+ >>> sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
368
+ >>> context.verify_mode = ssl.CERT_REQUIRED
369
+ >>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt")
370
+ >>> conn = aiohttp.TCPConnector(verify_ssl=False)
371
+ >>> r = yield from aiohttp.request('get',
372
+ ... 'https://example.com', connector=conn)
373
+
374
+
349
375
Unix domain sockets
350
376
-------------------
351
377
You can’t perform that action at this time.
0 commit comments