Fix: Don't reuse a connection on redirect if certs match but DNS does not. For better
locality and performance OkHttp attempts to use the same pooled connection across redirects and
follow-ups. It independently shares connections when the IP addresses and certificates match,
even if the host names do not. In 4.4.0 we introduced a regression where we shared a connection
when certificates matched but the DNS addresses did not. This would only occur when following a
redirect from one hostname to another, and where both hosts had common certificates.
Fix: Don't fail on a redirect when a client has configured a 'trust everything' trust manager.
Typically this would cause certain redirects to fail in debug and development configurations.
Version 4.4.0
2020-02-17
New: Support canceled() as an event that can be observed by EventListener. This should be
useful for splitting out canceled calls in metrics.
New: Publish a [bill of materials (BOM)][bom] for OkHttp. Depend on this from Gradle or Maven to
keep all of your OkHttp artifacts on the same version, even if they're declared via transitive
dependencies. You can even omit versions when declaring other OkHttp dependencies.
dependencies {
api(platform("com.squareup.okhttp3:okhttp-bom:4.4.0"))
api("com.squareup.okhttp3:okhttp") // No version!
api("com.squareup.okhttp3:logging-interceptor") // No version!
}
New: Upgrade to Okio 2.4.3.
implementation("com.squareup.okio:okio:2.4.3")
Fix: Limit retry attempts for HTTP/2 REFUSED_STREAM and CANCEL failures.
Fix: Retry automatically when incorrectly sharing a connection among multiple hostnames. OkHttp
shares connections when hosts share both IP addresses and certificates, such as squareup.com
and www.squareup.com. If a server refuses such sharing it will return HTTP 421 and OkHttp will
automatically retry on an unshared connection.
Fix: Don't crash if a TLS tunnel's response body is truncated.
Fix: Don't track unusable routes beyond their usefulness. We had a bug where we could track
certain bad routes indefinitely; now we only track the ones that could be necessary.
Fix: Defer proxy selection until a proxy is required. This saves calls to ProxySelector on
calls that use a pooled connection.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Bumps okhttp from 3.2.0 to 4.4.1.
Changelog
Sourced from okhttp's changelog.
Commits
046f7f2
Prepare for release 4.4.1.04c7303
Merge pull request #5861 from square/jwilson.0308.too_aggressive_71046d4
Don't reuse a connection on redirect if certs match but DNS does not (4.4.x)7ea7c15
Merge pull request #5856 from square/jwilson.0307.no_trustsf5d669c
Allow for users who have disabled certificate checks in dev. (#5835)44124ba
Prepare for release 4.4.0.3f946d0
Merge pull request #5795 from square/jwilson.0217.change_healthy_check19cb19a
Be smarter about connection health checks4e6699e
Merge pull request #5789 from square/jwilson.0216.give_up134ac98
Don't do infinite retries on server-canceled callsDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired)