gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.2k stars 10.33k forks source link

Unable to verify the first certificate #35210

Closed M-Fasciano closed 2 years ago

M-Fasciano commented 2 years ago

Preliminary Checks

Description

Hi there, I'm trying to get Data out of Drupal and Into Gatsby but I'm having a problem with this error unable to verify the first certificate. Hope you can help me.

Reproduction Link

https://github.com/M-Fasciano/drupal-gatsby

Steps to Reproduce

  1. Install Drupal 9 https://ddev.readthedocs.io/en/stable/users/cli-usage/#drupal-9-quickstart
  2. cd frontend
  3. npm install
  4. gatsby develop ...

Expected Result

$ gatsby develop

success open and validate gatsby-config — 0.132 s
success load plugins — 1.067 s
success onPreInit — 3.724 s
success delete html and css files from previous builds — 0.359 s
success initialize cache — 0.134 s
success copy gatsby files — 0.236 s
success onPreBootstrap — 0.013 s
⠁ Starting to fetch data from Drupal
success source and transform nodes — 102.818 s
success building schema — 1.485 s
success createPages — 0.189 s
success createPagesStatefully — 0.074 s
success onPreExtractQueries — 0.011 s
success update schema — 0.492 s
success extract queries from components — 0.375 s
success run graphql queries — 0.274 s — 18/18 66.21 queries/second
success write out page data — 0.016 s
success write out redirect data — 0.001 s
⠄ onPostBootstrapdone generating icons for manifest
success onPostBootstrap — 0.356 s

info bootstrap finished - 122.444 s

You can now view gatsby-starter-default in the browser.

  http://localhost:8000/

View GraphiQL, an in-browser IDE, to explore your site's data and schema

  http://localhost:8000/___graphql

Actual Result

> frontend@1.0.0 start /Users/michele.fasciano/personal-projects/drupal-gatsby/frontend
> gatsby develop

success compile gatsby files - 0.457s
success load gatsby config - 0.060s
success load plugins - 1.901s
success onPreInit - 0.011s
success initialize cache - 0.136s
success copy gatsby files - 0.285s
success Compiling Gatsby Functions - 0.491s
success onPreBootstrap - 0.524s
success createSchemaCustomization - 0.022s
info Starting to fetch all data from Drupal

 ERROR 

unable to verify the first certificate

  RequestError: unable to verify the first certificate

  - index.js:962 ClientRequest.<anonymous>
    [frontend]/[got]/dist/source/core/index.js:962:111

  - index.js:43 ClientRequest.origin.emit
    [frontend]/[@szmarczak]/http-timer/dist/source/index.js:43:20

  - destroy.js:106 emitErrorNT
    internal/streams/destroy.js:106:8

  - destroy.js:74 emitErrorCloseNT
    internal/streams/destroy.js:74:3

  - task_queues.js:82 processTicksAndRejections
    internal/process/task_queues.js:82:21

failed Fetch all data from Drupal - 0.256s
warn The gatsby-source-drupal plugin has generated no Gatsby nodes. Do you need it?
success Checking for changed pages - 0.002s
success source and transform nodes - 0.527s
success building schema - 0.302s
success createPages - 0.001s
success createPagesStatefully - 0.135s
info Total nodes: 48, SitePage nodes: 4 (use --verbose for breakdown)
success Checking for changed pages - 0.001s
success write out redirect data - 0.002s
success Build manifest and related icons - 0.168s
success onPostBootstrap - 0.177s
info bootstrap finished - 8.764s
success onPreExtractQueries - 0.002s
success extract queries from components - 1.986s
success write out requires - 0.008s
success run page queries - 0.037s - 3/3 80.20/s
⠀
You can now view frontend in the browser.
⠀
  http://localhost:8000/
⠀
View GraphiQL, an in-browser IDE, to explore your site's data and schema
⠀
  http://localhost:8000/___graphql
⠀
Note that the development build is not optimized.
To create a production build, use gatsby build
⠀
success Building development bundle - 15.202s
success Writing page-data.json files to public directory - 0.083s - 3/4 48.04/s

Environment

System:
    OS: macOS 11.6.1
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.6 - /usr/local/bin/node
    npm: 6.14.15 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 99.0.4844.83
    Edge: 99.0.1150.46
    Firefox: 98.0.1
    Safari: 15.1
  npmPackages:
    gatsby: ^4.10.2 => 4.10.2
    gatsby-plugin-google-analytics: ^4.10.0 => 4.10.0
    gatsby-plugin-image: ^2.10.0 => 2.10.0
    gatsby-plugin-manifest: ^4.10.1 => 4.10.1
    gatsby-plugin-mdx: ^3.10.1 => 3.10.1
    gatsby-plugin-react-helmet: ^5.10.0 => 5.10.0
    gatsby-plugin-sharp: ^4.10.1 => 4.10.1
    gatsby-plugin-sitemap: ^5.10.1 => 5.10.1
    gatsby-source-drupal: ^5.10.0 => 5.10.0
    gatsby-source-filesystem: ^4.10.0 => 4.10.0
    gatsby-transformer-sharp: ^4.10.0 => 4.10.0
  npmGlobalPackages:
    gatsby-cli: 2.11.11

Config Flags

No response

LekoArts commented 2 years ago

Have you already checked out https://github.com/gatsbyjs/gatsby/issues/15441 & https://github.com/gatsbyjs/gatsby/issues/14990? It's not clear from your issue if you're using a self-signed certificate.

M-Fasciano commented 2 years ago

@LekoArts I'm not using a self-signed certificate.

M-Fasciano commented 2 years ago

I've fixed the issue following this.

rwitchell commented 1 year ago

anyone coming here: if you are running SSL certificates for local development, using mkcert: you might need to run

export NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem"

source: https://github.com/FiloSottile/mkcert#using-the-root-with-nodejs