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

Gatsby development cannot issue a proper certificate #15043

Closed
rayriffy opened this issue Jun 22, 2019 · 5 comments
Closed

Gatsby development cannot issue a proper certificate #15043

rayriffy opened this issue Jun 22, 2019 · 5 comments
Assignees
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@rayriffy
Copy link
Contributor

rayriffy commented Jun 22, 2019

Description

gatsby develop --https is failed to serve proper SSL certificate, resulting in binary termination.

Term

Steps to reproduce

Pull a author/rayriffy branch of rayriffy/rayriffy-blog and then start development server by using yarn dev

Expected result

It should be able to develop locally with HTTPS protocol.

Actual result

It doesn't

Failed attempts

  • Clear cache with gatsby clean
  • Re-install node
  • Cloning new repository
  • Reset entire macOS

Environment

  System:
    OS: macOS 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.15.3 - /usr/local/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/local/bin/python
  Browsers:
    Chrome: 75.0.3770.80
    Safari: 12.1.1
  npmPackages:
    gatsby: ^2.9.2 => 2.10.0 
    gatsby-image: ^2.2.1 => 2.2.1 
    gatsby-plugin-feed: ^2.3.0 => 2.3.0 
    gatsby-plugin-google-analytics: ^2.1.0 => 2.1.0 
    gatsby-plugin-google-fonts: ^1.0.1 => 1.0.1 
    gatsby-plugin-manifest: ^2.2.0 => 2.2.0 
    gatsby-plugin-netlify: ^2.1.0 => 2.1.0 
    gatsby-plugin-netlify-cache: ^1.2.0 => 1.2.0 
    gatsby-plugin-react-helmet: ^3.1.0 => 3.1.0 
    gatsby-plugin-remove-serviceworker: ^1.0.0 => 1.0.0 
    gatsby-plugin-robots-txt: ^1.4.0 => 1.4.0 
    gatsby-plugin-sharp: ^2.2.1 => 2.2.1 
    gatsby-plugin-sitemap: ^2.2.0 => 2.2.0 
    gatsby-plugin-styled-components: ^3.1.0 => 3.1.0 
    gatsby-plugin-typescript: ^2.1.0 => 2.1.0 
    gatsby-plugin-typography: ^2.3.0 => 2.3.0 
    gatsby-remark-copy-linked-files: ^2.1.0 => 2.1.0 
    gatsby-remark-embed-gist: ^1.1.7 => 1.1.7 
    gatsby-remark-embed-spotify: ^2.0.2 => 2.0.2 
    gatsby-remark-embed-video: ^1.7.1 => 1.7.1 
    gatsby-remark-images: ^3.0.14 => 3.1.0 
    gatsby-remark-prismjs: ^3.3.0 => 3.3.0 
    gatsby-remark-responsive-iframe: ^2.2.0 => 2.2.0 
    gatsby-remark-smartypants: ^2.1.0 => 2.1.0 
    gatsby-source-filesystem: ^2.0.39 => 2.1.0 
    gatsby-transformer-json: ^2.2.0 => 2.2.0 
    gatsby-transformer-remark: ^2.3.12 => 2.5.0 
    gatsby-transformer-sharp: ^2.2.0 => 2.2.0 

@rayriffy
Copy link
Contributor Author

This also not working on default starter site, too.

Term

New environment (after reset macOS)


  System:
    OS: macOS 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.4.0 - /usr/local/bin/node
    Yarn: 1.17.0 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
  Languages:
    Python: 2.7.10 - /usr/bin/python
  Browsers:
    Chrome: 75.0.3770.100
    Safari: 12.1.1
  npmPackages:
    gatsby: ^2.10.0 => 2.10.0 
    gatsby-image: ^2.2.1 => 2.2.1 
    gatsby-plugin-manifest: ^2.2.0 => 2.2.0 
    gatsby-plugin-offline: ^2.2.0 => 2.2.0 
    gatsby-plugin-react-helmet: ^3.1.0 => 3.1.0 
    gatsby-plugin-sharp: ^2.2.1 => 2.2.1 
    gatsby-source-filesystem: ^2.1.0 => 2.1.0 
    gatsby-transformer-sharp: ^2.2.0 => 2.2.0 

@eknowles
Copy link
Contributor

I had this issue yesterday, I was able to allow the build to happen but not fix the issue.
adding the following to .env.development will accept it
NODE_TLS_REJECT_UNAUTHORIZED=0

@sidharthachatterjee sidharthachatterjee added the type: bug An issue or pull request relating to a bug in Gatsby label Jun 26, 2019
@rayriffy
Copy link
Contributor Author

@eknowles That method will definitely work too but I think it's not a best practice.

@chrisbuttery
Copy link
Contributor

Our team has also faced this issue.
We added the same flag to our start command.

"start": "NODE_TLS_REJECT_UNAUTHORIZED=0 gatsby develop --https --port 8003",

@m-allanson
Copy link
Contributor

Thanks @rayriffy - there's another issue tracking this at #14990. I'm going to close this one as a duplicate.

If anyone's able to investigate this comment and create a PR, we would love your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

6 participants