Fix HttpsURLConnectionTest for CTSv2.
test_getSSLSocketFactory and test_getDefaultSSLSocketFactory
fail when run after SSLSocketFactoryTest
the SSLSocketFactoryTest forces SSLSocketFactory to return a new SocketFactory
object as part of the test. However, the instance held by HttpsURLConnection
is not updated which means that SSLSocketFactory and HttpsURLConnection
have different instances of SSLSocketFactory.
test_getDefaultSSLSocketFactory verifies that the default SSLSocketFactory
in HttpsUrlConnection is the *same* object as what is returned by
SSLSocketFactory -- not just equal. Therefore this change updates the
SSLSocketFactory in HttpsURLConnection before running the tests in
HttpsURLConnectionTest. This allows for testing of getSSLSocketFactory
and getDefaultSSLSocketFactory without being impacted by other tests.
(cherry picked from commit ab4e7de36fbef96853e5e0e105e7afb50c9645b6)
1 file changed