Skip to content

Commit

Permalink
[Synthetics] Add client certificate reference to docs (#4351)
Browse files Browse the repository at this point in the history
* [Synthetics] Add client certificate reference to docs

---------

Co-authored-by: Colleen McGinnis <colleen.j.mcginnis@gmail.com>
  • Loading branch information
emilioalvap and colleenmcginnis authored Oct 15, 2024
1 parent 15dde46 commit 9410c58
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 2 deletions.
46 changes: 45 additions & 1 deletion docs/en/observability/synthetics-configuration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,51 @@ For all available options, refer to the https://playwright.dev/docs/test-configu
Do not attempt to run in headful mode (using `headless:false`) when running through Elastic's global managed testing infrastructure or Private Locations as this is not supported.
====

Below are details on a few Playwright options that are particularly relevant to Elastic Synthetics including timeouts, timezones, and device emulation.
Below are details on a few Playwright options that are particularly relevant to Elastic Synthetics including TLS client authentication, timeouts, timezones, and device emulation.

[discrete]
[[synthetics-configuration-playwright-options-client-certificates]]
== TLS client authentication
To enable TLS client authentication, set the https://playwright.dev/docs/api/class-testoptions#test-options-client-certificates[`clientCertificates`] option in the configuration file:

[NOTE]
=====
Path-based options `{certPath, keyPath, pfxPath}` are only supported on Private Locations, defer to in-memory alternatives `{cert, key, pfx}` when running on locations hosted by Elastic.
=====

[source,js]
----
playwrightOptions: {
clientCertificates: [
{
origin: 'https://example.com',
certPath: './cert.pem',
keyPath: './key.pem',
passphrase: 'mysecretpassword',
},
{
origin: 'https://example.com',
cert: Buffer.from("-----BEGIN CERTIFICATE-----\n..."),
key: Buffer.from("-----BEGIN RSA PRIVATE KEY-----\n..."),
passphrase: 'mysecretpassword',
}
],
}
----

[TIP]
=====
When using Synthetics monitor UI, `cert`, `key` and `pfx` can simply be specified using a string literal:
[source,js]
----
clientCertificates: [
{
cert: "-----BEGIN CERTIFICATE-----\n...",
// Not cert: Buffer.from("-----BEGIN CERTIFICATE-----\n..."),
}
],
----
=====

[discrete]
[[synthetics-configuration-playwright-options-timeouts]]
Expand Down
42 changes: 41 additions & 1 deletion docs/en/serverless/synthetics/synthetics-configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,47 @@ For all available options, refer to the [Playwright documentation](https://playw
Do not attempt to run in headful mode (using `headless:false`) when running through Elastic's global managed testing infrastructure or Private Locations as this is not supported.
</DocCallOut>

Below are details on a few Playwright options that are particularly relevant to Elastic Synthetics including timeouts, timezones, and device emulation.
Below are details on a few Playwright options that are particularly relevant to Elastic Synthetics including TLS client authentication, timeouts, timezones, and device emulation.

<div id="synthetics-configuration-playwright-options-client-certificates"></div>

### TLS client authentication
To enable TLS client authentication, set the [`clientCertificates`](https://playwright.dev/docs/api/class-testoptions#test-options-client-certificates) option in the configuration file:

<DocCallOut title="Note">
Path-based options `{certPath, keyPath, pfxPath}` are only supported on Private Locations, defer to in-memory alternatives `{cert, key, pfx}` when running on locations hosted by Elastic.
</DocCallOut>

```js
playwrightOptions: {
clientCertificates: [
{
origin: 'https://example.com',
certPath: './cert.pem',
keyPath: './key.pem',
passphrase: 'mysecretpassword',
},
{
origin: 'https://example.com',
cert: Buffer.from("-----BEGIN CERTIFICATE-----\n..."),
key: Buffer.from("-----BEGIN RSA PRIVATE KEY-----\n..."),
passphrase: 'mysecretpassword',
}
],
}
```

<DocCallOut title="Tip">
When using Synthetics monitor UI, `cert`, `key` and `pfx` can simply be specified using a string literal:
```js
clientCertificates: [
{
cert: "-----BEGIN CERTIFICATE-----\n...",
// Not cert: Buffer.from("-----BEGIN CERTIFICATE-----\n..."),
}
],
```
</DocCallOut>

<div id="synthetics-configuration-playwright-options-timeouts"></div>

Expand Down

0 comments on commit 9410c58

Please sign in to comment.