api / org.gradle.caching.http / HttpBuildCache

HttpBuildCache

open class HttpBuildCache : AbstractBuildCache

Configuration object for the HTTP build cache. The build cache only supports BASIC authentication currently.

Cache entries are loaded via GET and stored via PUT requests.

For a GET request we expect a 200 or 404 response and for PUT we expect any 2xx response. Other responses are treated as recoverable or non-recoverable errors, depending on the status code. E.g. we treat authentication failures (401 and 409) as non-recoverable while an internal server error (500) is recoverable.

Since
3.5

Constructors

<init>

HttpBuildCache()

Functions

credentials

open fun credentials(configuration: Action<in HttpBuildCacheCredentials>): Unit

Configures the credentials used to access the HTTP cache backend.

getCredentials

open fun getCredentials(): HttpBuildCacheCredentials

Returns the credentials used to access the HTTP cache backend.

getUrl

open fun getUrl(): URI

Returns the URI to the cache.

isAllowUntrustedServer

open fun isAllowUntrustedServer(): Boolean

Specifies whether it is acceptable to communicate with an HTTP build cache backend with an untrusted SSL certificate.

The SSL certificate for the HTTP build cache backend may be untrusted since it is internally provisioned or a self-signed certificate.

In such a scenario, you can either configure the build JVM environment to trust the certificate, or set this property to true to disable verification of the server's identity.

Allowing communication with untrusted servers keeps data encrypted during transmission, but makes it easier for a man-in-the-middle to impersonate the intended server and capture data.

This value has no effect if a server is specified using the HTTP protocol (i.e. has SSL disabled).

setAllowUntrustedServer

open fun setAllowUntrustedServer(allowUntrustedServer: Boolean): Unit

Specifies whether it is acceptable to communicate with an HTTP build cache backend with an untrusted SSL certificate.

The SSL certificate for the HTTP build cache backend may be untrusted since it is internally provisioned or a self-signed certificate.

In such a scenario, you can either configure the build JVM environment to trust the certificate, or set this property to true to disable verification of the server's identity.

Allowing communication with untrusted servers keeps data encrypted during transmission, but makes it easier for a man-in-the-middle to impersonate the intended server and capture data.

This value has no effect if a server is specified using the HTTP protocol (i.e. has SSL disabled).

setUrl

open fun setUrl(url: String): Unit
open fun setUrl(url: URL): Unit
open fun setUrl(url: URI): Unit

Sets the URL of the cache. The URL must end in a '/'.

Inherited Functions

isEnabled

open fun isEnabled(): Boolean

{@inheritDoc}

isPush

open fun isPush(): Boolean

{@inheritDoc}

setEnabled

open fun setEnabled(enabled: Boolean): Unit

{@inheritDoc}

setPush

open fun setPush(push: Boolean): Unit

{@inheritDoc}