1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-17 08:42:25 +03:00
Commit Graph

2210 Commits

Author SHA1 Message Date
jwilson
98a2ce65a4 [maven-release-plugin] prepare for next development iteration 2016-02-26 10:22:36 -05:00
jwilson
6e236ce3b8 [maven-release-plugin] prepare release parent-2.7.5 parent-2.7.5 2016-02-26 10:22:34 -05:00
jwilson
6d136f18b1 Update the changelog for 2.7.5. 2016-02-26 10:16:56 -05:00
Jake Wharton
63f7466715 Merge pull request #2373 from square/jwilson_0225_certpinner_cherrypicks
Backport more CertificatePinner fixes to the 2.x branch
2016-02-25 22:27:40 -05:00
jwilson
650486ba17 Don't require the CA root to be self-signed.
Some root certificates may not be.

Also test the limits of the certificate chain length, and put defense
in for weird unexpected cycles in the trusted certificates.

Conflicts:
	okhttp-tests/src/test/java/com/squareup/okhttp/internal/tls/CertificateChainCleanerTest.java
2016-02-25 21:14:13 -05:00
jwilson
ae703552b9 Always build full chains with CertificateChainCleaner.
We had a bug on Android where the trust root index would return trusted
intermediate certificates when we called findTrustAnchorByIssuerAndSignature().
This would lead to a partial chain, which would fail the pin check
unnecessarily.

Also permit that method to return null, as it does when the certificate
is not trusted.
2016-02-25 21:05:59 -05:00
jwilson
a7aaf78255 Update changelog for 2.7.4. 2016-02-07 22:34:02 -05:00
jwilson
9c78865eee [maven-release-plugin] prepare for next development iteration 2016-02-07 22:21:13 -05:00
jwilson
edaa258106 [maven-release-plugin] prepare release parent-2.7.4 parent-2.7.4 2016-02-07 22:21:10 -05:00
Jake Wharton
5377f25d9e Merge pull request #2326 from square/jwilson_0207_backport_pinning_fixes
Backport CertificatePinner fixes to the 2.x branch
2016-02-07 22:17:57 -05:00
jwilson
1094d74922 Support the GMS security provider when searching for the trust manager.
Closes https://github.com/square/okhttp/issues/2323
2016-02-07 21:51:45 -05:00
jwilson
cb7951aca7 Don't build a trust root index on Android.
We can just cheat and use reflection to use Conscrypt's trust root index
directly. This results in a substantial savings in app startup - 500
milliseconds or more.

Closes: https://github.com/square/okhttp/issues/2321

Conflicts:
	okhttp-tests/src/test/java/com/squareup/okhttp/internal/tls/CertificateAuthorityCouncilTest.java
	okhttp-tests/src/test/java/okhttp3/CertificateAuthorityCouncilTest.java
	okhttp-tests/src/test/java/okhttp3/CertificateChainCleanerTest.java
	okhttp/src/main/java/com/squareup/okhttp/CertificatePinner.java
	okhttp/src/main/java/com/squareup/okhttp/internal/Platform.java
	okhttp/src/main/java/com/squareup/okhttp/internal/tls/CertificateAuthorityCouncil.java
	okhttp/src/main/java/okhttp3/OkHttpClient.java
	okhttp/src/main/java/okhttp3/internal/tls/CertificateAuthorityCouncil.java
	okhttp/src/main/java/okhttp3/internal/tls/CertificateChainCleaner.java
2016-02-07 21:51:17 -05:00
jwilson
831230aaf6 [maven-release-plugin] prepare for next development iteration 2016-02-06 22:13:31 -05:00
jwilson
2df2565bba [maven-release-plugin] prepare release parent-2.7.3 parent-2.7.3 2016-02-06 22:13:28 -05:00
jwilson
532c2d2f76 Update changelog for 2.7.3. 2016-02-06 22:09:22 -05:00
Jake Wharton
b78bb3ae13 Merge pull request #2320 from square/jwilson_0206_certpinner
Backport CertificatePinner root certificate support to the 2.x branch
2016-02-06 21:00:02 -05:00
jwilson
69ea9aae2f Generalize the API in SslContextBuilder for fancier tests.
Conflicts:
	mockwebserver/src/main/java/com/squareup/okhttp/internal/SslContextBuilder.java
2016-02-06 14:04:07 -05:00
jwilson
62b42bf275 Start using CertificateAuthorityCouncil in CertificatePinner.
The wiring is definitely a bit more awkward than I would like. The
CertificateAuthorityCountil is a non-public class, and this change
sneaks an instance into the CertificatePinner that couples it to
the OkHttp client's SSLSocketFactory.

A nicer solution is to expose CertificateAuthorityCouncil as a public
API type, and add it to Address.java. Unfortunately that's currently
pretty awkward, especially because I'm not ready to commit to the
name CertificateAuthorityCouncil or its API.

Closes: https://github.com/square/okhttp/issues/1699

Conflicts:
	okhttp/src/main/java/com/squareup/okhttp/CertificatePinner.java
	okhttp/src/main/java/okhttp3/OkHttpClient.java
2016-02-06 13:51:18 -05:00
jwilson
ddbabf7780 New CertificateAuthorityCouncil class to normalize certificate chains.
The goal of this is to get the root CA certificate into the certificate
chain, so that it can be considered by the certificate pinner. The work
to integrate CertificateAuthorityCouncil with CertificatePinner will
come in a follow-up PR.

See: https://github.com/square/okhttp/issues/1699

Conflicts:
	mockwebserver/src/main/java/com/squareup/okhttp/internal/SslContextBuilder.java
	okhttp-tests/src/test/java/com/squareup/okhttp/CertificatePinnerTest.java
	okhttp-tests/src/test/java/com/squareup/okhttp/URLConnectionTest.java
2016-02-06 13:29:57 -05:00
jwilson
a2bf207c98 Teach OkHttp to lookup the X509TrustManagerFactory.
Right now there's problems with our ability to confirm certificate pins with
root certificates because we don't actually know which certificate authority
was used.

This unblocks that work.

This code is particularly fragile and gross. There's no API to get the
TrustManager from an SSLSocketFactory. We can potentially change the way
that we compute the initial SSLSocketFactory, but this approach is most
general.

This is motivated by https://github.com/square/okhttp/issues/1699

Conflicts:
	okhttp/src/main/java/com/squareup/okhttp/internal/Platform.java
	okhttp/src/main/java/okhttp3/OkHttpClient.java
2016-02-06 13:21:08 -05:00
jwilson
6b98d856e6 [maven-release-plugin] prepare for next development iteration 2016-01-08 00:27:51 -05:00
jwilson
abf0341402 [maven-release-plugin] prepare release parent-2.7.2 parent-2.7.2 2016-01-08 00:27:47 -05:00
jwilson
485ea8e3ec Update changelog for 2.7.2. 2016-01-08 00:23:47 -05:00
jwilson
61dac0fb5a Don't eagerly release pools on cache hits.
We might still need them to handle a redirect.

Closes: https://github.com/square/okhttp/issues/2198
2016-01-08 00:22:02 -05:00
jwilson
a62836f2da [maven-release-plugin] prepare for next development iteration 2016-01-01 11:13:40 -05:00
jwilson
e871c6068a [maven-release-plugin] prepare release parent-2.7.1 parent-2.7.1 2016-01-01 11:13:35 -05:00
jwilson
b1f9a299fb Changelog for 2.7.1 2016-01-01 11:05:24 -05:00
jwilson
dbb2327f42 Prepare to cut the 2.7.1 release. 2016-01-01 10:59:42 -05:00
Jake Wharton
8a711b84c6 Merge pull request #2179 from square/jwilson_1231_skip_health_check
Don't do health checks on brand new connections.
2015-12-31 12:54:02 -05:00
jwilson
9401e45a4d Don't do health checks on brand new connections.
This is imperfect, but it should save some unnecessary work and will
hopefully prevent RouteSelector from attempting a route when none is
available.

https://github.com/square/okhttp/issues/2151
2015-12-31 11:20:05 -05:00
jwilson
a36b1fb73c [maven-release-plugin] prepare release parent-2.7.0 parent-2.7.0 2015-12-13 20:35:26 -05:00
Jake Wharton
768964c996 Merge pull request #2088 from square/jwilson_1213_dont_leak
Don't leak connections when HttpURLConnection crashes.
2015-12-13 20:08:42 -05:00
Jake Wharton
78d24df1f3 Merge pull request #2086 from square/jwilson_1213_allocations_package_obsolete
The allocations package is obsolete.
2015-12-13 20:08:05 -05:00
Jake Wharton
cc1add8737 Merge pull request #2087 from square/jwilson_1213_apis
Hide overly-visible APIs in ConnectionPool.
2015-12-13 20:07:27 -05:00
jwilson
45260b51b1 Don't leak connections when HttpURLConnection crashes. 2015-12-13 10:07:42 -05:00
jwilson
c099f69d0b Hide overly-visible APIs in ConnectionPool. 2015-12-13 09:18:55 -05:00
jwilson
390d0ae2e7 The allocations package is obsolete.
Ideas from this became our StreamAllocation and RealConnection class.
2015-12-13 08:46:25 -05:00
jwilson
5fb2e48653 Update changelog for 2.7.0. 2015-12-12 15:07:09 -05:00
jwilson
9480318507 Merge branch 'rburgst-master'
* rburgst-master:
  fix #1919: PROPFIND request should not redirect to GET request
2015-12-11 21:09:10 -05:00
Rainer Burgstaller
2d73da131d fix #1919: PROPFIND request should not redirect to GET request 2015-12-11 21:08:49 -05:00
Jesse Wilson
e7b55fd6fe Merge pull request #2080 from square/jwilson_1210_stream_leaks
Fix some stream leaks.
2015-12-10 00:43:07 -05:00
jwilson
479ea36f8b Fix some stream leaks.
There's a few places where OkHttp could leak a connection that needed to be
closed. With our new connection pool model this is easier to find. This fixes
two specific problems:
 - too many redirects doesn't release the last used connection
 - interceptors that throw runtime exceptions don't release the connection

There are likely more situations. I have hacked together a small little test
harness to make finding these leaks easier; that's not included in this PR.
2015-12-10 00:33:59 -05:00
Jake Wharton
860d3a5242 Merge pull request #2077 from square/jwilson_1208_leaked_connections
Detect leaked connections.
2015-12-09 17:25:06 -05:00
jwilson
4ae314a1f2 Detect leaked connections.
This is already suggesting some bugs in OkHttp itself.
2015-12-08 22:05:06 -05:00
Jake Wharton
308df8295c Merge pull request #2072 from square/jwilson_1207_max_idle_connections
Prune connections when the max idle limit is exceeded.
2015-12-07 22:52:47 -05:00
jwilson
9ffc45dbe0 Prune connections when the max idle limit is exceeded. 2015-12-07 22:43:08 -05:00
Jake Wharton
33fe9fb7e4 Merge pull request #2067 from square/jwilson_1206_restore_eviction
Restore time-based eviction.
2015-12-07 17:04:52 -05:00
jwilson
f212b6780e Restore time-based eviction.
We still don't implement a limit on the number of open connections.
That needs to come afterwards, and will be difficult because we'll
need to add policy on which connections to evict.
2015-12-06 11:52:23 -05:00
Jesse Wilson
068156ba1b Merge pull request #2065 from square/jwilson_1205_listener
Turn IncomingStreamHandler into FramedConnection.Listener.
2015-12-06 10:04:53 -05:00
jwilson
38aaf7bca6 Turn IncomingStreamHandler into FramedConnection.Listener.
Add a callback invoked on settings changes. The concurrency here
is a little awkward because the calls into the listener are not
serialized.

This is going to be used in a follow up change to keep the
connection's allocation limit in sync.
2015-12-06 09:59:24 -05:00