Gatsby: How to refresh the localhost https certificate?

Created on 21 Jul 2019  Â·  7Comments  Â·  Source: gatsbyjs/gatsby

Summary

I tried following the gatsbyjs local https guide here, but I got an error while setting it up. Now, when I try running npm run develop -- --https, it does not start because of the error
UNHANDLED REJECTION request to https://localhost:8000/___graphql failed, reason: unable to verify the first certificate

Relevant information

When trying to set up local https, I put in the wrong sudo password a couple of times, and exited the process. Now it's automatically trying to generate certificates on the fly that are wrong and the building/running fails every time.

Environment (if relevant)

File contents (if changed)

package.json: N/A
"start": "npm run develop -- --https",

The solution here worked, but firefox/chrome said it was a security risk to visit the localhost website. How can i reset it and try setting up https again?

stale? question or discussion

Most helpful comment

For now my workaround is NODE_TLS_REJECT_UNAUTHORIZED=0 gatsby develop --https

All 7 comments

I'm using the --https development option and the same issue occurs.

After upgrading from "gatsby": "^2.8.2", to "gatsby": "^2.13.50", the develop command fails:

UNHANDLED REJECTION request to https://localhost:8000/___graphql failed, reason: unable to verify the first certificate



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

  - index.js:1455 ClientRequest.<anonymous>
    [locker-web]/[node-fetch]/lib/index.js:1455:11

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

  - destroy.js:50 emitErrorAndCloseNT
    internal/streams/destroy.js:50:3

  - next_tick.js:63 process._tickCallback
    internal/process/next_tick.js:63:19

For now my workaround is NODE_TLS_REJECT_UNAUTHORIZED=0 gatsby develop --https

Would also like to see this looked at. Ran the --https command without sudo, now unable to setup a (truly secure) HTTPS connection through Gatsby.

One thing that would be helpful– and I may be able to help with this– is to present a warning on the local-https docs page to indicate users should maybe first try this using sudo before they run it? At least until this bug is resolved.

I simply ran gatsby develop --https for the first time in a new project and got a similar error.

TypeError: Cannot read property 'replace' of undefined

  - develop.js:367 module.exports
    [suscribela]/[gatsby]/dist/commands/develop.js:367:42


  - next_tick.js:189 process._tickCallback
    internal/process/next_tick.js:189:7

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

Do not stale, please.

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.

Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theduke picture theduke  Â·  3Comments

magicly picture magicly  Â·  3Comments

brandonmp picture brandonmp  Â·  3Comments

jimfilippou picture jimfilippou  Â·  3Comments

Oppenheimer1 picture Oppenheimer1  Â·  3Comments