This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年03月10日 01:20 by jcea, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (5) | |||
|---|---|---|---|
| msg100777 - (view) | Author: Jesús Cea Avión (jcea) * (Python committer) | Date: 2010年03月10日 01:20 | |
Current SSL module doesn't manage SSL sessions, so any connection must do the full SSL handshake. SSL/TLS support session restarting, when an old SSL context is used in a new connection, so you don't need to do the full SSL handshake. This is a huge performance improvement. I think SSL module should keep a small pool of sessions in core, to reuse. Better yet: a) In SSL sockets, a method should be added to get the SSL context. b) When creating a SSL socket, in client mode, a new optional parameter should be accepted, for a SSL context. c) When creating a SSL socket, in server mode, we have two options: a) provide a dictionary or similar, with different contexts for possible clients connections or, better b) provide a callback the SSL module will call when getting an incoming connection, with a session ID as a parameter. The callback can provide a session SSL state or "None". This second approach allow for session management, like expiration or persistence to disk. (the second option is equivalent to the first if the dict-like object includes this logic inside) What do you think?. |
|||
| msg104368 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年04月27日 21:39 | |
issue8550 is probably a prerequisite for implementing this properly. |
|||
| msg118438 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2010年10月12日 17:15 | |
http://www.openssl.org/docs/ssl/SSL_CTX_set_session_cache_mode.html suggests that SSL session caching already occurs by default in server mode: "SSL_SESS_CACHE_SERVER Server sessions are added to the session cache. When a client proposes a session to be reused, the server looks for the corresponding session in (first) the internal session cache (unless SSL_SESS_CACHE_NO_INTERNAL_LOOKUP is set), then (second) in the external cache if available. If the session is found, the server will try to reuse the session. This is the default." A nice and easy thing to do would be to export the statistics given by http://www.openssl.org/docs/ssl/SSL_CTX_sess_number.html# . |
|||
| msg216685 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2014年04月17日 11:09 | |
Ok, I propose the following plan: - add a new opaque type allowing to wrap a SSL_SESSION - add a get_session() method to SSLSocket, returning the current session - add an optional "session=..." parameter to SSLContext.wrap_socket, allowing to specify a session which we hope to reuse during the handshake There is however, one complication (from OpenSSL man pages): """SSL_SESSION objects keep internal link information about the session cache list, when being inserted into one SSL_CTX object's session cache. One SSL_SESSION object, regardless of its reference count, must therefore only be used with one SSL_CTX object (and the SSL objects created from this SSL_CTX object).""" So we would somehow also need to keep a pointer to the SSL context in our session object wrapper, and check that the session isn't reused with another context... (yuck) |
|||
| msg275049 - (view) | Author: Christian Heimes (christian.heimes) * (Python committer) | Date: 2016年09月08日 15:28 | |
I'm going to implement sessions in #19500. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:58 | admin | set | github: 52353 |
| 2016年09月08日 15:28:50 | christian.heimes | set | status: open -> closed versions: + Python 3.6, - Python 3.5 superseder: ftplib: Add client-side SSL session resumption messages: + msg275049 resolution: duplicate |
| 2015年07月15日 20:02:14 | mladen.milosevic | set | nosy:
+ mladen.milosevic |
| 2015年04月13日 17:23:02 | lilydjwg | set | nosy:
+ lilydjwg |
| 2014年04月17日 11:09:25 | pitrou | set | messages: + msg216685 |
| 2014年04月17日 10:47:27 | pitrou | set | versions: + Python 3.5, - Python 3.3 |
| 2013年08月24日 22:51:47 | dstufft | set | nosy:
+ dstufft |
| 2013年06月13日 23:51:12 | christian.heimes | set | nosy:
+ christian.heimes |
| 2013年04月09日 20:27:17 | WadeC | set | nosy:
+ WadeC |
| 2013年03月08日 08:48:07 | fweimer | set | nosy:
+ fweimer |
| 2010年12月14日 21:32:19 | pitrou | set | versions: + Python 3.3, - Python 3.2 |
| 2010年10月12日 17:15:37 | pitrou | set | messages: + msg118438 |
| 2010年04月28日 10:03:31 | giampaolo.rodola | set | nosy:
+ giampaolo.rodola |
| 2010年04月27日 21:39:25 | pitrou | set | versions:
- Python 2.7 nosy: + pitrou messages: + msg104368 dependencies: + Expose SSL contexts stage: needs patch |
| 2010年03月10日 04:38:42 | brian.curtin | set | priority: normal nosy: + janssen |
| 2010年03月10日 01:20:51 | jcea | create | |