Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self-Signed Certificate Error #512

Closed
jhartma opened this issue May 10, 2017 · 7 comments
Closed

Self-Signed Certificate Error #512

jhartma opened this issue May 10, 2017 · 7 comments
Labels

Comments

@jhartma
Copy link

jhartma commented May 10, 2017

What are you trying to achieve?

Run the test on localhost with a self-signed ssl certificate.

What do you get instead?

 -- FAILURES:
1) Check @dev "before each" hook: Before for "I create a new user":
   error: request to https://localhost/graphql failed, reason: self signed certificate
@APshenkin
Copy link
Collaborator

For running tests with self-signed ssl certificate:
Nightmare:
Add this in Nightmare config:

switches: {
                'ignore-certificate-errors': true
            },

WebdriverIO:
Chrome: nothing to do
Firefox:

desiredCapabilities: {
                "acceptInsecureCerts": true
            }

SeleniumWebdriver/Protractor:
Chrome: nothing to do
Firefox:

capabilities: {
                "acceptInsecureCerts": true
            }

@allenhwkim
Copy link
Contributor

allenhwkim commented Apr 17, 2018

@APshenkin what's option for puppeteer?
---- EDIT -----
I found this works for Puppeteer codecept.json

{
  ...
  "helpers": {
    "Puppeteer": {
      ....
      "chrome": {
        "ignoreHTTPSErrors": true
      }
    }
  }

@JeffroeBodine
Copy link

Is there any compatible example for ignoring HTTPSErrors in the Rest Helper? I've been all over the Axios docs and found a closed issue with a workaround -> axios/axios#12

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; But setting that doesn't seem to help

@vsawant1608
Copy link

vsawant1608 commented May 22, 2020

I have this setting in my codeceptjs.

    helpers: {
        CustomSetup: {
            require: './setup.js'
        },
        Puppeteer: {
            url: 'http://localhost:3020',
            show: false,
            windowSize: '1312x1400',
            chrome: {
                args: ['--ignore-certificate-errors']
            },
            keepCookies: true
        },
        REST: {
            endpoint: 'https://localhost:3020',
            onRequest: () => {}
        }
    }

and this gives me certificate expired when I try to run test case like this

Feature('Get data using REST helper');

Before(async (I, login) => {
    await login('testUser');
});

Scenario('case list API', async I => {
    const res = await I.sendGetRequest('/users');

    expect(res.status).to.eql(200);
});

Any idea on how to fix this? I already have process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'

@lind-eduard
Copy link

For running tests with self-signed ssl certificate:
Nightmare:
Add this in Nightmare config:

switches: {
                'ignore-certificate-errors': true
            },

WebdriverIO:
Chrome: nothing to do
Firefox:

desiredCapabilities: {
                "acceptInsecureCerts": true
            }

SeleniumWebdriver/Protractor:
Chrome: nothing to do
Firefox:

capabilities: {
                "acceptInsecureCerts": true
            }

Are there something like this for Playwright webkit browser?

@sibyaugustine
Copy link

sibyaugustine commented Nov 19, 2020

For running tests with self-signed ssl certificate:
Nightmare:
Add this in Nightmare config:

switches: {
                'ignore-certificate-errors': true
            },

WebdriverIO:
Chrome: nothing to do
Firefox:

desiredCapabilities: {
                "acceptInsecureCerts": true
            }

SeleniumWebdriver/Protractor:
Chrome: nothing to do
Firefox:

capabilities: {
                "acceptInsecureCerts": true
            }

Are there something like this for Playwright webkit browser?

ignoreHTTPSErrors should work.

Playwright: {
  url: 'http://localhost:8080',
  show: true,
  browser: 'chromium',
  ignoreHTTPSErrors : true
}

@ngraf
Copy link
Contributor

ngraf commented Apr 20, 2021

ignoreHTTPSErrors should work.

😀👍🏻 Playwright with option ignoreHTTPSErrors : true works like a charm for me within "chromium", "firefox" and "webkit"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants