This is like MockWebServer, but it speaks SPDY behind the scenes
instead of HTTP. The goal with this change is to make it very easy
to test interactions between SPDY and HTTP features like cookies,
fault tolerance and caching.
In particular:
- Don't require OkHttp to depend on Jetty's non-boot package for
Android. This was causing ugly, confidence-smashing dalvik
errors in Android apps.
- Don't prevent HTTP on Java6 just because SPDY isn't available.
This uses gross reflection and dynamic proxies! That's sad, but
it's encapsulated so users won't have to know it exists.
We were only returning 'true' once we were already in a tunnel.
This was bogus. In theory a TLS tunnel sending extra data could
be corrupted due to this bug.
Also migrate one of the TLS tunnel tests to use SslContextBuilder
instead of TestSSLContext.
Because there are no platform APIs to generate certificates,
this needs a third party library (bouncy castle) to do the
heavy lifting.
Each target platform has its own built-in crypto library:
- The JVM has its own internal crypto library. It uses
key stores like "JCA".
- Android has its own internal crypto library that's
based on bouncy castle. It is repackaged in com.android
and is not used by this code.
With this change, okhttp brings its own copy of bouncy castle
for cert generation. Once the certificate is generated we're
done with bouncy castle, and use the platform libraries for TLS.
This approach allows us to use one codebase on either platform.
* Add checkstyle and correct anything that failed.
* Expand README.md to have more info for the upcoming release.
* Resolve plugin warnings in pom.xml.
This is a fork of okhttp from http://code.google.com/p/okhttp.
I'm moving it to Github since that's where my code reviewers
are. I've renamed the core package from com.google.okhttp to
com.squareup.okhttp because Square is where I expect ongoing
development of this project to take place.
All code in this project is subject to be contributed upstream
to AOSP. In particular, all code in the libcore package is
derived from AOSP and intended to be contributed back to AOSP
on an ongoing basis.