shazow/urllib3 — pull request #388 by jschneier (2014-05-12 20:29:15+00:00)
Title: DO NOT MERGE - properly close connections and apply pool certs for https pools

cc @Lukasa @shazow

In my debugging of #369 I came across the fact that we aren't propagating changes to connections if we change the pool certs settings. This change fixes all of the current test but adds a failing test that illustrates a case that my change does not fix; since we are reusing the connection object (and its underlying connected socket) ``connect`` will never get invoked again and thus neither will ``ssl_wrap_socket``. I don't see a great way of fixing this outside of some fairly hacky things (e.g. make ``self.ca_certs`` a property and trigger a ``.close`` on every connection when it gets set) and I'm not sure about the ramifications this has on proxies.