History log of /libcore/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/https/HttpsURLConnectionTest.java
Revision Date Author Comments
76fafa7b18ae7e977fabb64742fd3c1449ee0f57 14-Feb-2014 Neil Fuller <nfuller@google.com> Change HttpsURLConnectionTest for okhttp update.

In preparation for an okhttp update. The test broke with the
next okhttp version when tested due to some buffering issue on
devices with long user agent strings: with larger user agents
the headers would be flushed "early" and the client would only
receive the headers and not the body in the single read it
does (which broke the test under CTS). With shorter user agents
(e.g. "Java0" as used under Vogar) it would buffer everything,
send it all and the test would pass.

Rather than fix the webserver in the test it has been removed
and replaced with one based on MockWebServer.

Change-Id: I4ce8558cebb2b87b567c3dbfb75580a575a30946
0731920fdf845358cc13ce78292f9e80e143f915 28-Mar-2012 Brian Carlstrom <bdc@google.com> Disable TLSv1.1 and TLSv1.2 by default

Bug: 6234791

Change-Id: I5d829211c9e1d5672fc96e42ef603c53d789e695
3d74b4bec8543e6e3f89eafe3afe0925f3a69f01 28-Mar-2012 Brian Carlstrom <bdc@google.com> Disable TLSv1.1 and TLSv1.2 by default

Bug: 6234791

Change-Id: I5d829211c9e1d5672fc96e42ef603c53d789e695
3e6dd45baa0d7f9b4fa06f4ade76e088b59cc7bf 16-Mar-2012 Brian Carlstrom <bdc@google.com> Tracking openssl-1.0.1

Bug: 6168278

Change-Id: I240d2cbc91f616fd486efc5203e2221c9896d90f
19c77c6a6da8cea7327ccbb741963ac76d3fae53 05-May-2011 Jesse Wilson <jessewilson@google.com> Address some test failures in the HTTP client.

Change-Id: I44783aa7cadd51ed6b9e7aabc94144c60252c095
http://b/3180373
5bcbe1c84468a25fec1e5b4e1dd636f917c73422 16-Nov-2010 Brian Carlstrom <bdc@google.com> HttpsURLConnectionTest rewrite and URLConnectionTest updates

Rewrote HttpsURLConnectionTest to work with current SSLSocket
implementation which more strictly follows RI behavior.

Also made upates to URLConnectionTest related to HttpsURLConnection
- changed assertContent call connect() explictly to illustrate problem
with https proxy case also seen by HttpsURLConnectionTest
- Rewrote testConnectTimeouts to work reliably. Before if often
worked on WiFi but not on mobile networks where a "HTTP/1.1 501 Bad
Gateway" would be seen causing a FileNotFoundException.
- Changed testConnectViaHttpProxyToHttpsUsingHttpProxySystemProperty
to match expectation that https does not use the http.proxyHost
values. Added new testConnectViaHttpProxyToHttpsUsingProxyArgWithNoProxy
which should have the same behavior as the fixed
testConnectViaHttpProxyToHttpsUsingHttpProxySystemProperty

git cherry-pick -e f02c695ed03e708623d9365dec26d533356ef2d0

Bug: 3184701
Change-Id: Id25f619d2437db607deaf35aeb1d5e817514b92f
f02c695ed03e708623d9365dec26d533356ef2d0 16-Nov-2010 Brian Carlstrom <bdc@google.com> HttpsURLConnectionTest rewrite and URLConnectionTest updates

Rewrote HttpsURLConnectionTest to work with current SSLSocket
implementation which more strictly follows RI behavior.

Also made upates to URLConnectionTest related to HttpsURLConnection
- changed assertContent call connect() explictly to illustrate problem
with https proxy case also seen by HttpsURLConnectionTest
- Rewrote testConnectTimeouts to work reliably. Before if often
worked on WiFi but not on mobile networks where a "HTTP/1.1 501 Bad
Gateway" would be seen causing a FileNotFoundException.
- Changed testConnectViaHttpProxyToHttpsUsingHttpProxySystemProperty
to match expectation that https does not use the http.proxyHost
values. Added new testConnectViaHttpProxyToHttpsUsingProxyArgWithNoProxy
which should have the same behavior as the fixed
testConnectViaHttpProxyToHttpsUsingHttpProxySystemProperty

Change-Id: I397f55905524e2bbb587533f258ef0418ca8af80
4ed5008cf0cefc32ddc743b6cfc8a627c40b42ba 25-Sep-2010 Jesse Wilson <jessewilson@google.com> Fix an obsolete import from HttpsURLConnectionTest.

Change-Id: Ib9043003ee16ca37d9b9bf5bc4cdcc351efc77ff
6e65088f21ac5bda5d25fade13ee360c5cba3457 25-Sep-2010 Jesse Wilson <jessewilson@google.com> Rely on the test runner to ensure a pristine VM.

Change-Id: I6f5bfad6f861eb7b398ed7d86747d66cea4f2343
http://b/issue?id=2660429
df349b3eaf4d1fa0643ab722173bc3bf20a266f5 14-Sep-2010 Brian Carlstrom <bdc@google.com> Fix HttpsURLConnectionTest failures

Focusing on HttpsURLConnectionTest.test_doOutput found a number of
unrelated issues, all of which are addressed by this change:
- {HttpURLConnection,HttpsURLConnection}.connect not ignored on subsequent calls
- OpenSSLSessionImpl.{getPeerCertificates,getPeerCertificateChain} did not include client certificate
- OpenSSLSocketImpl.getSession did not skip handshake when SSLSession was already available
- Fix 3 test issues in HttpsURLConnectionTest
- Fix 2 test issues in NativeCryptoTest

Details:

HttpsURLConnectionTest tests (such as test_doOutput) that
tried to call URLConnection.connect() at the end of the test
were raising exception. The RI URLConnection.connect
documentation says calls on connected URLConnections should be ignored.

Use "connected" instead of "connection != null" as reason to ignore "connect"

luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnectionImpl.java
luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/HttpsURLConnectionImpl.java

Converted one caller of getPeerCertificateChain to
getPeerCertificates which is the new fast path. Track
OpenSSLSessionImpl change to take "java" vs "javax" certificates.

luni/src/main/java/org/apache/harmony/xnet/provider/jsse/AbstractSessionContext.java

Move SSL_SESSION_get_peer_cert_chain to be SSL_get_peer_cert_chain
(similar to SSL_get_certificate). The problem was that
SSL_SESSION_get_peer_cert_chain used SSL_get_peer_cert_chain which
in the server case did not include the client cert itself, which
required a call to SSL_get_peer_certificate, which needed the
SSL instance pointer.

luni/src/main/java/org/apache/harmony/xnet/provider/jsse/NativeCrypto.java
luni/src/main/native/NativeCrypto.cpp

Improved NativeCrypto_SSL_set_verify tracing

luni/src/main/native/NativeCrypto.cpp

As a side effect of the move to
NativeCrypto.SSL_get_peer_certificate, it no longer made sense to
lazily create the peer certificate chain since the SSLSession
should not depend on a particular SSL instance. The peer chain is
now passed in as part of the constructor and the peerCertifcates
in the OpenSSLSession can be final (also made localCertificates
final). Since peerCertifcates is the newew (java not javax) API
and more commonly used, it is what is created from the native
code, and peerCertificateChain is not derived from peerCertifcates
instead of vice versa.

luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java

Factored out code to used to create local certificate chain to
from array of DER byte arrays into createCertChain so it can be
reused to create peer certificate chain.

luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java

Fix OpenSSLSocketImpl.getSession to check for existing sslSession
to and skip handshake, which was causing an exception if the
connection had already been closed.

luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java

Fix test issues: Removed PrintStream wrapper of System.out which
was causing vogar to lose output. Added null check in closeSocket,
which can happen in timeout case. Removed use of
InputStream.available which in OpenSSLSocket case returned 0,
causing test to fail incorrectly.

luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/https/HttpsURLConnectionTest.java

Updating to track change to SSL_get_peer_cert_chain. Also fixed
some other unrelated test failures caused by IOException on
shutdown and false start (aka SSL_MODE_HANDSHAKE_CUTTHROUGH)
causing clientCallback.handshakeCompleted to be false.

luni/src/test/java/org/apache/harmony/xnet/provider/jsse/NativeCryptoTest.java

Bug: b/2981767
Change-Id: Id083beb6496558296c2f74f51ab0970e158b23a9
507154fd78b95c46be07a52aedd92a45e3783a62 08-Sep-2010 Jesse Wilson <jessewilson@google.com> Cleanup HttpsURLConnectionTest to help with failures.

Change-Id: I7d035c612e4069cdeab7185cadb323846259e957
http://b/issue?id=2981779
f33eae7e84eb6d3b0f4e86b59605bb3de73009f3 13-May-2010 Elliott Hughes <enh@google.com> Remove all trailing whitespace from the dalvik team-maintained parts of libcore.

Gentlemen, you may now set your editors to "strip trailing whitespace"...

Change-Id: I85b2f6c80e5fbef1af6cab11789790b078c11b1b
307a6a094ae439b0509161f36b1c260e3f00fc0d 04-Feb-2010 Elliott Hughes <enh@google.com> Remove obviously bogus @KnownFailure annotations.

We've already agreed @KnownFailure Must Die (to be replaced by expectations for
DalvikRunner), but some are -- I think -- obviously in need of investigation.
This patch removes @KnownFailure for all cases where the reason looks bogus.
I've left the @KnownFailure annotations in cases where I it looks "reasonable"
in that we simply haven't implemented the functionality (pack200, say), and
a few other cases. Those should probably be done in a separate patch that adds
expectations at the same time.

But these ones, I think, all need investigating. (There's a scary number of
Arabic-related bugs in here, given that we're supposed to be shipping Arabic
in froyo.)
d37c804ccd11e38ee9221194866a152a4de6c8e9 24-Oct-2009 Jesse Wilson <jessewilson@google.com> A new hygenic way for tests to clean up before or after execution.

This replaces PrefsTester and is more general purpose.
210834b065f80d2bb9adc194f9e3fc662a12a95d 12-Oct-2009 Jesse Wilson <jessewilson@google.com> Adding timeouts to HttpsURLConnectionTest.

See bug http://b/issue?id=2180571
e01d752ccba75c8c5e53235ec1e6466f816407da 24-Apr-2009 Urs Grob <> AI 147687: Several fixes for failing tests in the cts host. also tests that timeout
are now marked with BrokenTest to exclude them for the time being until
we have a way to execute them.
BUG=1285921

Automated import of CL 147687
5b4db481fd2dd84cf1f54136b0c6cbb0fbc72b03 21-Apr-2009 Urs Grob <> AI 147126: am: CL 147121 Fixes for tests in the luni module.
There are still some tests that are failing in the cts host. This CL will fix most of them in the luni module.
Original author: ursg
Merged from: //branches/cupcake/...

Automated import of CL 147126
b90da8218274400c8710211d467ed28f23bc28ba 21-Apr-2009 Urs Grob <> AI 147127: am: CL 147126 am: CL 147121 Fixes for tests in the luni module.
There are still some tests that are failing in the cts host. This CL will fix most of them in the luni module.
Original author: ursg
Merged from: //branches/cupcake/...
Original author: android-build

Automated import of CL 147127
214a4e01cfb8ac07474c128b9431b19b7ed1b99b 21-Apr-2009 Urs Grob <> AI 147121: Fixes for tests in the luni module.
There are still some tests that are failing in the cts host. This CL will fix most of them in the luni module.
BUG=1285921

Automated import of CL 147121
cdd1dac0489aa82d07ad80415622b38732abce65 31-Mar-2009 Jorg Pleumann <> AI 143657: am: CL 143626 am: CL 143453 Bringing the luni tests down to zero failures.
Original author: jorgp
Merged from: //branches/cupcake/...
Original author: android-build
Merged from: //branches/donutburger/...

Automated import of CL 143657
4c43aef80171b88eef5e922052ef1ee54ffc514d 31-Mar-2009 Jorg Pleumann <> AI 143626: am: CL 143453 Bringing the luni tests down to zero failures.
Original author: jorgp
Merged from: //branches/cupcake/...

Automated import of CL 143626
a566c3ecc8c821172e27d89444dd7cadfbdc369b 30-Mar-2009 Jorg Pleumann <> AI 143453: Bringing the luni tests down to zero failures.
BUG=1285921

Automated import of CL 143453
7387da1059039afc7d8fd3e48e4d0712fff5dfaf 19-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake_rel/...@140373
adc854b798c1cfe3bfd4c27d68d5cee38ca617da 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
1c0fed63c71ddb230f3b304aac12caffbedf2f21 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
a0881d052ee72e3f7e773374e9b1aa75fbd6be4c 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
dd828f42a5c83b4270d4fbf6fce2da1878f1e84a 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
fdb2704414a9ed92394ada0d1395e4db86889465 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution