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

2197 Commits

Author SHA1 Message Date
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
Jesse Wilson
496802c758 Merge pull request #2062 from square/jwilson_1203_fancy_encoding
Don't log gzipped data. It isn't human readable.
2015-12-04 22:53:32 -05:00
jwilson
c071f6fef4 Don't log gzipped data. It isn't human readable. 2015-12-04 22:47:08 -05:00
jwilson
b6d278363a Merge branch 'chaitanyajun12-master'
* chaitanyajun12-master:
  added documentation #2050
2015-12-04 22:35:49 -05:00
Krishna Chaitanya M
10b77165b9 added documentation #2050 2015-12-04 22:35:18 -05:00
Jesse Wilson
c09c5c1b41 Merge pull request #2055 from square/jwilson_1201_max_concurrent_streams
Honor the max concurrent streams setting.
2015-12-02 13:28:17 -05:00
jwilson
c5f58e4545 Honor the max concurrent streams setting.
Closes https://github.com/square/okhttp/issues/1484
2015-12-02 12:44:41 -05:00
Jake Wharton
b59a7527ca Merge pull request #2052 from square/jwilson_1130_fewer_buffers
Fewer buffers in FramedConnections.
2015-11-30 23:11:09 -05:00
jwilson
7fc2993c42 Fewer buffers in FramedConnections.
Previously we had a BufferedSource in the RealConnection and another
independent BufferedSource in the FramedConnection. We only need one.
2015-11-30 22:57:12 -05:00
Jake Wharton
bb518a9aac Merge pull request #2048 from square/jwilson_1129_async_cancel
Change async cancel to cancel the raw socket only.
2015-11-29 23:15:02 -05:00
jwilson
ee87f8036f Change async cancel to cancel the raw socket only.
Previously we could close an SSL socket which does synchronous I/O. This
made it unreasonable to cancel a call on a UI thread.

Closes: https://github.com/square/okhttp/issues/1592
2015-11-29 22:58:45 -05:00
Jesse Wilson
d00778c8cf Merge pull request #2045 from square/jwilson_1127_new_connections_model
First draft of the new new stream allocations model.
2015-11-28 11:54:12 -05:00
jwilson
c358656c87 First draft of the new new stream allocations model. 2015-11-28 09:36:06 -05:00
Jake Wharton
e0d34ebdd7 Merge pull request #2043 from square/jwilson_1126_newbuilder
Test interaction of Authenticator and transparent Gzip.
2015-11-26 23:28:48 -05:00