Update dependency com.squareup.okhttp3:okhttp to v4.5.0 (#2770)
Update dependency com.squareup.okhttp3:okhttp to v4.5.0 (#2770)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [com.squareup.okhttp3:okhttp](https://square.github.io/okhttp/) ([source](https://togithub.com/square/okhttp)) | minor | `4.0.1` -> `4.5.0` |

---

### Release Notes

<details>
<summary>square/okhttp</summary>

### [`v4.5.0`](https://togithub.com/square/okhttp/blob/master/CHANGELOG.md#Version-450)

_2020-04-06_

**This release fixes a severe bug where OkHttp incorrectly detected and recovered from unhealthy
connections.** Stale or canceled connections were incorrectly attempted when they shouldn't have
been, leading to rare cases of infinite retries. Please upgrade to this release!

-   Fix: don't return stale DNS entries in `DnsOverHttps`. We were caching DNS results indefinitely
    rather than the duration specified in the response's cache-control header.
-   Fix: Verify certificate IP addresses in canonical form. When a server presents a TLS certificate
    containing an IP address we must match that address against the URL's IP address, even when the
    two addresses are encoded differently, such as `192.168.1.1` and `0::0:0:FFFF:C0A8:101`. Note
    that OkHttp incorrectly rejected valid certificates resulting in a failure to connect; at no
    point were invalid certificates accepted.
-   New: `OkHttpClient.Builder.minWebSocketMessageToCompress()` configures a threshold for
    compressing outbound web socket messages. Configure this with 0L to always compress outbound
    messages and `Long.MAX_VALUE` to never compress outbound messages. The default is 1024L which
    compresses messages of size 1 KiB and larger. (Inbound messages are compressed or not based on
    the web socket server's configuration.)
-   New: Defer constructing `Inflater` and `Deflater` instances until they are needed. This saves
    memory if web socket compression is negotiated but not used.

### [`v4.4.1`](https://togithub.com/square/okhttp/blob/master/CHANGELOG.md#Version-441)

_2020-03-08_

-   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.

### [`v4.4.0`](https://togithub.com/square/okhttp/blob/master/CHANGELOG.md#Version-440)

_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.

    ```kotlin
    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.

    ```kotlin
    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.

### [`v4.3.1`](https://togithub.com/square/okhttp/blob/master/CHANGELOG.md#Version-431)

_2020-01-07_

-   Fix: Don't crash with a `NullPointerException` when a web socket is closed before it connects.
    This regression was introduced in OkHttp 4.3.0.
-   Fix: Don't crash with an `IllegalArgumentException` when using custom trust managers on 
    Android 10. Android uses reflection to look up a magic `checkServerTrusted()` method and we 
    didn't have it.
-   Fix: Explicitly specify the remote server name when making HTTPS connections on Android 5. In
    4.3.0 we introduced a regression where server name indication (SNI) was broken on Android 5.

### [`v4.3.0`](https://togithub.com/square/okhttp/blob/master/CHANGELOG.md#Version-430)

_2019-12-31_

-   Fix: Degrade HTTP/2 connections after a timeout. When an HTTP/2 stream times out it may impact
    the stream only or the entire connection. With this fix OkHttp will now send HTTP/2 pings after 
    a stream timeout to determine whether the connection should remain eligible for pooling.

-   Fix: Don't call `EventListener.responseHeadersStart()` or `responseBodyStart()` until bytes have
    been received. Previously these events were incorrectly sent too early, when OkHttp was ready to
    read the response headers or body, which mislead tracing tools. Note that the `responseFailed()`
    event always used to follow one of these events; now it may be sent without them.

-   New: Upgrade to Kotlin 1.3.61.

-   New: Match any number of subdomains with two asterisks in `CertificatePinner`. For example, 
    `**.squareup.com` matches `us-west.www.squareup.com`, `www.squareup.com` and `squareup.com`.

-   New: Share threads more aggressively between OkHttp's HTTP/2 connections, connection pool, 
    web sockets, and cache. OkHttp has a new internal task runner abstraction for managed task
    scheduling. In your debugger you will see new thread names and more use of daemon threads.

-   Fix: Don't drop callbacks on unexpected exceptions. When an interceptor throws an unchecked 
    exception the callback is now notified that the call was canceled. The exception is still sent 
    to the uncaught exception handler for reporting and recovery.

-   Fix: Un-deprecate `MockResponse.setHeaders()` and other setters. These were deprecated in OkHttp
    4.0 but that broke method chaining for Java callers.

-   Fix: Don't crash on HTTP/2 HEAD requests when the `Content-Length` header is present but is not
    consistent with the length of the response body.

-   Fix: Don't crash when converting a `HttpUrl` instance with an unresolvable hostname to a URI.
    The new behavior strips invalid characters like `"` and `{` from the hostname before converting.

-   Fix: Undo a performance regression introduced in OkHttp 4.0 caused by differences in behavior
    between Kotlin's `assert()` and Java's `assert()`. (Kotlin always evaluates the argument; Java
    only does when assertions are enabled.) 

-   Fix: Honor `RequestBody.isOneShot()` in `HttpLoggingInterceptor`.

### [`v4.2.2`](https://togithub.com/square/okhttp/blob/master/CHANGELOG.md#Version-422)

_2019-10-06_

-   Fix: When closing a canceled HTTP/2 stream, don't send the `END_STREAM` flag. This could cause
    the server to incorrectly interpret the stream as having completed normally. This is most useful
    when a request body needs to cancel its own call.

### [`v4.2.1`](https://togithub.com/square/okhttp/blob/master/CHANGELOG.md#Version-421)

_2019-10-02_

-   Fix: In 4.1.0 we introduced a performance regression that prevented connections from being
    pooled in certain situations. We have good test coverage for connection pooling but we missed
    this because it only occurs if you have proxy configured and you share a connection pool among
    multiple `OkHttpClient` instances.

    This particularly-subtle bug was caused by us assigning each `OkHttpClient` instance its own
    `NullProxySelector` when an explicit proxy is configured. But we don't share connections when
    the proxy selectors are different. Ugh!

### [`v4.2.0`](https://togithub.com/square/okhttp/blob/master/CHANGELOG.md#Version-420)

_2019-09-10_

-   New: API to decode a certificate and private key to create a `HeldCertificate`. This accepts a
    string containing both a certificate and PKCS [#&#8203;8](https://togithub.com/square/okhttp/issues/8)-encoded private key.

    ```kotlin
    val heldCertificate = HeldCertificate.decode("""
        |-----BEGIN CERTIFICATE-----
        |MIIBYTCCAQegAwIBAgIBKjAKBggqhkjOPQQDAjApMRQwEgYDVQQLEwtlbmdpbmVl
        |cmluZzERMA8GA1UEAxMIY2FzaC5hcHAwHhcNNzAwMTAxMDAwMDA1WhcNNzAwMTAx
        |MDAwMDEwWjApMRQwEgYDVQQLEwtlbmdpbmVlcmluZzERMA8GA1UEAxMIY2FzaC5h
        |cHAwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASda8ChkQXxGELnrV/oBnIAx3dD
        |ocUOJfdz4pOJTP6dVQB9U3UBiW5uSX/MoOD0LL5zG3bVyL3Y6pDwKuYvfLNhoyAw
        |HjAcBgNVHREBAf8EEjAQhwQBAQEBgghjYXNoLmFwcDAKBggqhkjOPQQDAgNIADBF
        |AiAyHHg1N6YDDQiY920+cnI5XSZwEGhAtb9PYWO8bLmkcQIhAI2CfEZf3V/obmdT
        |yyaoEufLKVXhrTQhRfodTeigi4RX
        |-----END CERTIFICATE-----
        |-----BEGIN PRIVATE KEY-----
        |MEECAQAwEwYHKoZIzj0CAQYIKoZIzj0DAQcEJzAlAgEBBCA7ODT0xhGSNn4ESj6J
        |lu/GJQZoU9lDrCPeUcQ28tzOWw==
        |-----END PRIVATE KEY-----
        """.trimMargin())
    val handshakeCertificates = HandshakeCertificates.Builder()
        .heldCertificate(heldCertificate)
        .build()
    val server = MockWebServer()
    server.useHttps(handshakeCertificates.sslSocketFactory(), false)
    ```

    Get these strings with `HeldCertificate.certificatePem()` and `privateKeyPkcs8Pem()`.

-   Fix: Handshake now returns peer certificates in canonical order: each certificate is signed by
    the certificate that follows and the last certificate is signed by a trusted root.

-   Fix: Don't lose HTTP/2 flow control bytes when incoming data races with a stream close. If this
    happened enough then eventually the connection would stall.

-   Fix: Acknowledge and apply inbound HTTP/2 settings atomically. Previously we had a race where we
    could use new flow control capacity before acknowledging it, causing strict HTTP/2 servers to
    fail the call.

### [`v4.1.1`](https://togithub.com/square/okhttp/blob/master/CHANGELOG.md#Version-411)

_2019-09-05_

-   Fix: Don't drop repeated headers when validating cached responses. In our Kotlin upgrade we
    introduced a regression where we iterated the number of unique header names rather than then
    number of unique headers. If you're using OkHttp's response cache this may impact you.

### [`v4.1.0`](https://togithub.com/square/okhttp/blob/master/CHANGELOG.md#Version-410)

_2019-08-12_

[brotli]: https://togithub.com/google/brotli

-   **OkHttp's new okhttp-brotli module implements Brotli compression.** Install the interceptor to
    enable [Brotli compression][brotli], which compresses 5-20% smaller than gzip.

        val client = OkHttpClient.Builder()
            .addInterceptor(BrotliInterceptor)
            .build()

    This artifact has a dependency on Google's Brotli decoder (95 KiB).

-   New: `EventListener.proxySelectStart()`, `proxySelectEnd()` events give visibility into the
    proxy selection process.
-   New: `Response.byteString()` reads the entire response into memory as a byte string.
-   New: `OkHttpClient.x509TrustManager` accessor.
-   New: Permit [new WebSocket response codes][iana_websocket]: 1012 (Service Restart), 1013 (Try
    Again Later), and 1014 (invalid response from the upstream).
-   New: Build with Kotlin 1.3.41, BouncyCastle 1.62, and Conscrypt 2.2.1.
-   Fix: Recover gracefully when a coalesced connection immediately goes unhealthy.
-   Fix: Defer the `SecurityException` when looking up the default proxy selector.
-   Fix: Don't use brackets formatting IPv6 host names in MockWebServer.
-   Fix: Don't permit cache iterators to remove entries that are being written.

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Never, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#GoogleCloudPlatform/java-docs-samples).
GoogleCloudPlatform/java-docs-samples,GoogleCloudPlatform/java-docs-samples,GoogleCloudPlatform/java-docs-samples,GoogleCloudPlatform/java-docs-samples,GoogleCloudPlatform/java-docs-samples,GoogleCloudPlatform/java-docs-samples