cloudflare
Version:
The official TypeScript library for the Cloudflare API
61 lines • 2.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AutoOriginTLSKex = exports.BaseAutoOriginTLSKex = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../core/resource.js");
const path_1 = require("../../internal/utils/path.js");
var BaseAutoOriginTLSKex = /* @__PURE__ */ (() => {
class BaseAutoOriginTLSKex extends resource_1.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((0, path_1.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((0, path_1.path) `/zones/${zone_id}/settings/auto_origin_tls_kex`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseAutoOriginTLSKex._key = Object.freeze([
'ssl',
'autoOriginTLSKex',
]);
return BaseAutoOriginTLSKex;
})();
exports.BaseAutoOriginTLSKex = BaseAutoOriginTLSKex;
class AutoOriginTLSKex extends BaseAutoOriginTLSKex {
}
exports.AutoOriginTLSKex = AutoOriginTLSKex;
//# sourceMappingURL=auto-origin-tls-kex.js.map