diff --git a/cypress.config.js b/cypress.config.js index 80f0c792a..76447bd4a 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -1,6 +1,4 @@ const { defineConfig } = require("cypress"); -const fs = require("fs"); -const path = require("path"); module.exports = defineConfig({ e2e: { @@ -17,16 +15,33 @@ module.exports = defineConfig({ username: "admin", password: "admin", }, + clientCertificates: [ + { + url: "https://localhost:9200/.opendistro-ism*", + ca: ["cypress/resources/root-ca.pem"], + certs: [ + { + cert: "cypress/resources/kirk.pem", + key: "cypress/resources/kirk-key.pem", + passphrase: "", + }, + ], + }, + { + url: "https://localhost:9200/.opendistro-ism-config/_update_by_query/", + ca: ["cypress/resources/root-ca.pem"], + certs: [ + { + cert: "cypress/resources/kirk.pem", + key: "cypress/resources/kirk-key.pem", + passphrase: "", + }, + ], + }, + ], setupNodeEvents(on, config) { - on("task", { - readCertAndKey() { - const cert = fs.readFileSync(path.resolve(__dirname, "cypress/resources/kirk.pem")); - const key = fs.readFileSync(path.resolve(__dirname, "cypress/resources/kirk-key.pem")); - return { cert, key }; - }, - }); // implement node event listeners here return config; }, }, -}); +}); \ No newline at end of file diff --git a/cypress/resources/kirk-key.pem b/cypress/resources/kirk-key.pem index 1949c2613..fd1728cda 100644 --- a/cypress/resources/kirk-key.pem +++ b/cypress/resources/kirk-key.pem @@ -25,4 +25,4 @@ nBY2S57MSM11/MVslrEgGmYNnI4r1K25xlaqV6K6ztEJv6n69327MS4NG8L/gCU5 mQGwy8vIqMjAdHGLrCS35sVYBXG13knS52LJHvbVee39AbD5/LlWvjJGlQMzCLrw F7oILW5kXxhb8S73GWcuMbuQMFVHFONbZAZgn+C9FW4l7XyRdkrbR1MRZ2km8YMs /AHmo368d4PSNRMMzLHw8Q== ------END PRIVATE KEY----- \ No newline at end of file +-----END PRIVATE KEY----- diff --git a/cypress/resources/root-ca.pem b/cypress/resources/root-ca.pem index d33f5f721..854323e6f 100644 --- a/cypress/resources/root-ca.pem +++ b/cypress/resources/root-ca.pem @@ -25,4 +25,4 @@ YuXgN4KrIcMXQIuAXCx407c+pIlT/T1FNn+VQXwi56PYzxQKtlpoKUL3oPQE1d0V 1yVJon6RkUGtqBqKIuLksKwEr//ELnjmXit4LQKSnqKr0FTCB7seIrKJNyb35Qnq qy9a/Unhokrmdda1tr6MbqU8l7HmxLuSd/Ky+L0eDNtYv6YfMewtjg0TtAnFyQov rdXmeq1dy9HLo3Ds4AFz3Gx9076TxcRS/iI= ------END CERTIFICATE----- \ No newline at end of file +-----END CERTIFICATE-----