The Proxy class currently creates a SSLSocketFactory for each different host.
However, as far as I can tell, the created SSLSocketFactory instance
is configured exactly the same for all hosts.
So I wonder why the SSLSocketFactory instances cannot be shared
between different hosts?
I did a quick experiment, and the code seemed to still work OK if only
one SSLSocketFactory was created.
It would obviously be cheaper to re-use the factory for all hosts if possible.
Also, in order to implement Bug 55507, we would like to generate
certifcates for domains, not single hosts, and it would be a lot
easier to manage if we only needed to cache the factory once for each
domain.
|