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

FetchError: request to https://localhost:8000/___graphql failed, reason: unable to verify the first certificate #15441

Closed
sixclones opened this issue Jul 5, 2019 · 4 comments

Comments

@sixclones
Copy link

Hello,

The first time I run Gatsby with SSL activated, an error occured. So now the error is fixed, when I
run gatsby develop "-S", I got this :
FetchError: request to https://localhost:8000/___graphql failed, reason: unable to verify the first certificate
My tought is I haven't setting up my SSL certificate and I don't know how to "reset" it to setting up in a good way.
I tried to clean gatsby's cache and rm -rf node_modules, change nothing.

Environment

  System:
    OS: Linux 5.0 Ubuntu 19.04 (Disco Dingo)
    CPU: (4) x64 Intel(R) Core(TM) i3-6100 CPU @ 3.70GHz
    Shell: 5.5.1 - /usr/bin/zsh
  Binaries:
    Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
    Yarn: 1.1.0 - /usr/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 74.0.3729.131
    Firefox: 67.0.4
  npmPackages:
    gatsby: ^2.13.3 => 2.13.3 
    gatsby-plugin-postcss: ^2.1.0 => 2.1.0 
    gatsby-plugin-react-helmet: ^3.1.0 => 3.1.0 
    gatsby-plugin-sitemap: ^2.2.1 => 2.2.1 
@fraserisland
Copy link
Contributor

fraserisland commented Jul 8, 2019

This is a known bug related to #15441 you can use "NODE_TLS_REJECT_UNAUTHORIZED=0 gatsby develop --https" as a workaround though until it gets fixed though, so i'm going to close this for now

@sixclones
Copy link
Author

Thx for the answer.
FYI the related bug your are quoting is actually this bug. ^^
Just by curiousity, what's the bug ?

@bcanseco
Copy link

Seems like this is it #14990

@rwitchell
Copy link

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

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

No branches or pull requests

4 participants