okhttp v5.0.0-alpha.8 Release Notes
Fix: Change how
H2_PRIOR_KNOWLEDGEworks with HTTP proxies. Previously OkHttp assumed the proxy itself was a prior knowledge HTTP/2 server. With this update, OkHttp attempts a
CONNECTtunnel just as it would with HTTPS. For prior knowledge with proxies OkHttp's is now consistent with these curl arguments:
curl \ --http2-prior-knowledge \ --proxy localhost:8888 \ --proxytunnel \ http://squareup.com/robots.txt
Fix: Support executing OkHttp on kotlin-stdlib versions as old as 1.4. The library still builds on up-to-date Kotlin releases (1.6.21) but no longer needs that version as a runtime dependency. This should make it easier to use OkHttp in Gradle plugins.
Fix: Don't start the clock on response timeouts until the request body is fully transmitted. This is only relevant for duplex request bodies, because they are written concurrently when reading the response body.
MockResponse.inTunnel()is a new
mockwebserver3API to configure responses that are served while creating a proxy tunnel. This obsoletes both the
UPGRADE_TO_SSL_AT_ENDsocket option. (Only APIs on
mockwebserver3are changed; the old
okhttp3.mockwebserverAPIs remain as they always have been.