> Hmm. Why are we doing the monkeypatching anew every time we auth, and would
> it be possible to chain to the old implementation in some way rather than
> overwriting?
I thought about chaining, but ssl.wrap_socket(sock, A, B, C, D) is not the same as ssl.wrap_socket(ssl.wrap_socket(sock, A, B), C, D), so essentially the whole thing needs replacing anyway.
Good point on not re-patching every time we auth, but I thought that having the code close in location to where it takes effect will make it clearer to someone debugging later on, since monkeypatching is invisible unless you know it's happening.
> Hmm. Why are we doing the monkeypatching anew every time we auth, and would
> it be possible to chain to the old implementation in some way rather than
> overwriting?
I thought about chaining, but ssl.wrap_ socket( sock, A, B, C, D) is not the same as ssl.wrap_ socket( ssl.wrap_ socket( sock, A, B), C, D), so essentially the whole thing needs replacing anyway.
Good point on not re-patching every time we auth, but I thought that having the code close in location to where it takes effect will make it clearer to someone debugging later on, since monkeypatching is invisible unless you know it's happening.