1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-14 07:22:20 +03:00
Commit Graph

323 Commits

Author SHA1 Message Date
Jesse Wilson
875bfa3eef [maven-release-plugin] prepare release parent-3.12.1 2018-12-23 12:41:42 -05:00
Jesse Wilson
de4225084f Prepare for 3.12.1 development 2018-12-23 12:36:32 -05:00
Jesse Wilson
7f63a35ab1 [maven-release-plugin] prepare release parent-3.12.0 2018-11-16 23:44:12 -05:00
Benoit Quenaudon
3739c5cf20 Replaced List<Header> by a queue of Headers into Http2Stream 2018-10-22 14:38:07 -04:00
Benoit Quenaudon
c8cbb0d022 Send/Receive Headers via Http2 Frames 2018-10-12 18:32:03 -04:00
Yuri Schimke
077281796e Test for local port used in mock web server (#4246)
* Test for local port used

* fix checkstyle
2018-09-02 06:51:11 -04:00
Yuri Schimke
a01b511598 MockWebserver fix for IPv6 addresses (#4235)
Wrap IPv6 addresses with [] and return "/" path URIs for proxy CONNECT
2018-09-01 12:32:53 +01:00
Sergey Galkin
a146e50427 Shutdown MockWebServer after response (#4243) 2018-08-31 21:04:02 +01:00
Jesse Wilson
7ef5f55d38 [maven-release-plugin] prepare for next development iteration 2018-07-12 23:41:09 -04:00
Jesse Wilson
95ae0cf421 [maven-release-plugin] prepare release parent-3.11.0 2018-07-12 23:41:00 -04:00
Jesse Wilson
137e7de045 New API, HandshakeCertificates.addPlatformTrustedCertificates()
Also rename HeldCertificate.Builder.issuedBy() to signedBy(). 'Issued' is the
word used by certificates; 'signed' is the word used by cryptographers. I prefer
'signed'.
2018-07-12 10:51:33 -04:00
Jesse Wilson
37887141fe Rename TlsNode to HandshakeCertificates (#4141) 2018-07-12 06:39:20 +01:00
Jesse Wilson
b1bfe7130c New okhttp-tls module 2018-07-09 12:00:28 -04:00
Jesse Wilson
31c511f694 Rename SslClient to TlsNode and make it a public API
https://github.com/square/okhttp/issues/3934
2018-07-08 15:33:16 -04:00
Jesse Wilson
d908a676c2 Support client authentication in MockWebServer
Also expose the handshake in the RecordedResponse.

https://github.com/square/okhttp/issues/3934
2018-07-06 10:08:19 -04:00
Jesse Wilson
aac684aeae Retain interrupted state when throwing InterruptedIOException
The drawbacks seem small; the callsite needs to handle interruption anyway
because the thread is prone to interruption.

And the upside is that a single interrupt should now be sufficient to break
out an in-flight OkHttp call.

Note that although we're fixing this, thread interruption is not well tested
in OkHttp. Most users should prefer Call.cancel(), which is well tested and
doesn't rely on the caller to know which threads OkHttp is using to make
the actual HTTP request.

Closes: https://github.com/square/okhttp/issues/3945
2018-07-05 22:37:24 -04:00
Jesse Wilson
e983dd2ae0 HeldCertificate: a cert and its private key
This class has been in MockWebServer for a long time, but it's always been
in the internal package with an incomplete API. This change promotes it to
a public API.

It's not quite sufficient for use as-is; we also need to open source its
companion class 'SslClient' that represents who we trust (as a list of
root certificates) and who we are (as an optional held certificate plus
the chain to a root certificate).
2018-06-28 13:39:41 -04:00
Yuri Schimke
c3c9592474 better mock test fix 2018-06-17 15:13:34 +01:00
Yuri Schimke
327de18c95 Fix tests for now 2018-06-16 12:26:45 +01:00
Yuri Schimke
d66238d256 Use header delay instead of body delay before status line (#4011)
* Use header delay instead of body delay before status line
2018-05-29 19:10:12 +01:00
Jesse Wilson
db18f0e404 Rename H2C to H2_PRIOR_KNOWLEDGE. (#3996)
The string h2c is used with cleartext upgrades. We're not doing those here,
so that identifier isn't appropriate.
2018-05-12 01:29:21 -07:00
Jaye Pitzeruse
9a6f88dc34 gh-1019: Implemented prior knowledge approach to h2c (#3873) 2018-02-26 23:55:10 +00:00
Jesse Wilson
e86eb0e48b [maven-release-plugin] prepare for next development iteration 2018-02-24 13:33:57 -05:00
Jesse Wilson
c0739a4199 [maven-release-plugin] prepare release parent-3.10.0 2018-02-24 13:33:52 -05:00
Jesse Wilson
af6198a1e9 Fail HTTP/2 connections if the pong is not received. (#3878)
This removes the Ping abstraction from our http2 package. This was written as
if it were a public API, but never exposed to any callers but tests. Removing
it makes it easier to lock down how pings are used.

This also removes the NullServer class, replacing it with a new SocketPolicy
on MockWebServer. The new SocketPolicy, STALL_SOCKET_AT_START, allows us to
do TLS and negotiate an HTTP/2 connection without actually building a proper
Http2Connection and without responding to pings.

The behavior in HTTP/2 connections is modeled after our behavior in web sockets.
We count outgoing pings, incoming pongs, and confirm that the pongs are keeping
up. If later we make this policy more sophisticated we can track the changes
in both places.

Closes: https://github.com/square/okhttp/issues/3261
2018-02-22 18:37:34 -05:00
Jesse Wilson
6c66d6c41b Fail web sockets if the pong is not received (#3870)
There are several options for when to expect the pong response. I've
chosen to overload the ping interval. This seems reasonable because the
ping interval is the maximum amount of time that should elapse before
a connection failure is detected.

Closes: https://github.com/square/okhttp/issues/3227
2018-02-20 15:02:29 -05:00
Yuri Schimke
14215b8b3f cleanup travis output (#3853) 2018-02-17 09:25:41 -05:00
Johan von Forstner
e5fa0b989e Handle 100 (Continue) HTTP response gracefully regardless of whether it was requested/expected (#3766)
* Add a failing test for handling 100 response when it was not requested
(#3628)
* Implement reading the correct response after unrequested 100-continue
2018-02-17 11:21:40 +00:00
Jesse Wilson
d0418379a7 Move MockWebServer's internal package to not collide with OkHttp's. (#3837)
Hoping this may prevent problems with the Java Platform Module System.
2018-02-09 06:20:57 +00:00
Yuri Schimke
d27531afa9 Use manifest entry for java 9 module name (#3743)
* Use manifest entry for java 9 module name

* add group

* specific names

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml
2018-02-04 03:02:20 -05:00
Yuri Schimke
9cb3af2a03 Build Provider through the Platform (#3788) 2018-01-28 17:04:42 +00:00
Shaishav Gandhi
c22be89f4b Update to new Gradle dependency configurations (#3723)
* Update to new Gradle dependency configurations

Signed-off-by: shaishavgandhi05 <shaishgandhi@gmail.com>

* Add note for "api" usage

Signed-off-by: shaishavgandhi05 <shaishgandhi@gmail.com>

* Remove note on implementation vs. api depenedency
2017-12-17 14:01:32 -05:00
Jesse Wilson
2bb2dc4340 [maven-release-plugin] prepare for next development iteration 2017-11-18 14:38:02 -05:00
Jesse Wilson
23b6f7556d [maven-release-plugin] prepare release parent-3.9.1 2017-11-18 14:37:50 -05:00
jwilson
51311219af [maven-release-plugin] prepare for next development iteration 2017-09-04 17:00:21 -04:00
jwilson
51663fd08f [maven-release-plugin] prepare release parent-3.9.0 2017-09-04 17:00:16 -04:00
Jesse Wilson
6f029dd3de Fix MockWebServer websockets to be thread safe. (#3567)
Closing the sink while another thread is writing the sink is a
potential source for races.

Closes: https://github.com/square/okhttp/issues/3138
2017-08-31 21:33:47 -04:00
Jesse Wilson
e5f50b5bc6 Fix MockWebServer handling of 'Expect: 100 Continue' (#3563)
Previously we'd skip the request body unless the socket policy was
EXPECT_CONTINUE.

Closes: https://github.com/square/okhttp/issues/3498
2017-08-30 22:03:09 -04:00
Jesse Wilson
207f5579d3 Omit the message from MockWebServer's HTTP/2 :status header (#3556)
This was a bug carried over from SPDY.

Closes: https://github.com/square/okhttp/issues/3484
2017-08-30 18:25:44 -04:00
Stuart Neivandt
c77023cd03 Test Failure in MockWebServerTest (#3547)
* Lookup the FQDN given the MockWebServer hostname to compare with the HttpUrl hostname. Issue #3546.

* Update MockWebServer to use the FQDN for its host name. Issue #3546.
2017-08-30 10:22:58 -04:00
Igor Fedorenko
cd22113332 Fix occasional hang with http2 goaway frames
Http2Connection was dropping headers of healthy streams
after GOAWAY frame.

Fixes #3422

Signed-off-by: Igor Fedorenko <ifedorenko@salesforce.com>
2017-08-14 10:43:14 -04:00
Jesse Wilson
13d81f8d1b Test event listeners on request body failures (#3511) 2017-08-07 16:55:54 -04:00
Jesse Wilson
ed7709dbe1 Correctly report response body stream failures with HTTP/2. (#3508) 2017-08-07 09:50:16 -04:00
Chris Cunniff
58e531da69 Add missing test for MockResponse setHeaders (#3443) 2017-07-03 15:06:00 -04:00
jwilson
304d2c9630 [maven-release-plugin] prepare for next development iteration 2017-05-13 10:58:15 -04:00
jwilson
cb981daecf [maven-release-plugin] prepare release parent-3.8.0 2017-05-13 10:58:04 -04:00
jwilson
6f8cdcca1d [maven-release-plugin] prepare for next development iteration 2017-04-15 21:53:08 -04:00
jwilson
e56f561e93 [maven-release-plugin] prepare release parent-3.7.0 2017-04-15 21:53:02 -04:00
Andreas Ahlenstorf
62cab6dd2d Expose request URL as HttpUrl 2017-03-07 17:16:02 +01:00
jwilson
9690110f81 [maven-release-plugin] prepare for next development iteration 2017-01-29 14:14:39 -05:00