ignore HTTPS CERT Invalid error in AWS Canary run

0

I am trying to ignore HTTPS certificate error while using https:// URL. Have tried below configurations options, but nothing works for me.

Option 1: set ignoreHTTPSErrors as true in page.goto function

const response = await page.goto(url, { waitUntil: ['domcontentloaded'], timeout: 30000, ignoreHTTPSErrors: true});

Option 2: Set ignoreHTTPSErrors it globally in synthetic configuration

syntheticsConfiguration.setConfig({ defaultBrowserOptions: { ignoreHTTPSErrors: true, headless: true}, continueOnStepFailure: true, includeRequestHeaders: true, includeResponseHeaders: true, restrictedHeaders: [], restrictedUrlParameters: []

});
1 Answer
1

When dealing with HTTPS certificate errors in AWS Canary runs, it's important to understand that simply ignoring these errors is not recommended as it can pose security risks. However, if you absolutely need to proceed despite certificate issues for testing purposes, there are a few approaches you can try:

  1. Ensure you're using the latest version of the AWS Synthetics library, as improvements and bug fixes are regularly released.

  2. Instead of setting ignoreHTTPSErrors globally or in the page.goto function, try setting it when launching the browser:

const browser = await synthetics.getPage({
    browserOptions: {
        ignoreHTTPSErrors: true
    }
});
  1. If you're using a custom certificate or a self-signed certificate, you may need to add it to the trusted certificates list for your Canary. This can be done by including the certificate in your Canary's script and adding it to the Node.js trusted certificates.

  2. Check if the certificate issue is related to an expired or misconfigured certificate on the target website. If so, addressing the root cause would be the best solution.

  3. If the issue persists, you may need to implement a custom error handling mechanism in your Canary script to catch and handle the specific HTTPS errors you're encountering.

Remember that ignoring HTTPS errors should only be done in controlled testing environments and never in production scenarios, as it can expose your application to security vulnerabilities. If you continue to face issues after trying these approaches, consider reaching out to AWS Support for further assistance tailored to your specific use case.

Sources
AWS Certificate Manager Resources | Certificate Management | Amazon Web Services
Improper certificate validation | Amazon CodeGuru, Detector Library
Enabling and disabling HTTPS - AWS Elemental Conductor Live

profile picture
answered 3 months ago
profile picture
EXPERT
reviewed 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions