cloudflare
Version:
The official TypeScript library for the Cloudflare API
56 lines • 2.32 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { path } from "../../internal/utils/path.mjs";
export var BaseAutoOriginTLSKex = /* @__PURE__ */ (() => {
class BaseAutoOriginTLSKex extends APIResource {
/**
* Enable or disable Auto-Origin TLS KEX selection for the zone by sending
* `{"enabled": true}` or `{"enabled": false}`. When enabled, Cloudflare runs a
* periodic scan of the zone's origins to determine the preferred key-exchange
* algorithm and writes that preference to the edge so it is sent first in the TLS
* ClientHello to the origin.
*
* @example
* ```ts
* const response = await client.ssl.autoOriginTLSKex.edit({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* enabled: true,
* });
* ```
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch(path `/zones/${zone_id}/settings/auto_origin_tls_kex`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* When enabled, Cloudflare automatically selects the preferred TLS key-exchange
* algorithm to use when establishing the TLS connection to the zone's origin,
* picking from the algorithms permitted by the zone's
* `origin_tls_compliance_modes` setting. When disabled, the default key-exchange
* ordering is used.
*
* @example
* ```ts
* const autoOriginTLSKex =
* await client.ssl.autoOriginTLSKex.get({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(path `/zones/${zone_id}/settings/auto_origin_tls_kex`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseAutoOriginTLSKex._key = Object.freeze([
'ssl',
'autoOriginTLSKex',
]);
return BaseAutoOriginTLSKex;
})();
export class AutoOriginTLSKex extends BaseAutoOriginTLSKex {
}
//# sourceMappingURL=auto-origin-tls-kex.mjs.map