scottyzen / woonuxt

Static e-commerce powered by WooCommerce & Nuxt
https://woonuxt.com
GNU General Public License v3.0
678 stars 187 forks source link

Self-signed certificate #124

Open arnold-bernstein opened 9 months ago

arnold-bernstein commented 9 months ago

Hello I am running a wordpress installation in my local network behind an nginx reverse proxy with a self-signed ssl certificate. However the installation of woonuxt is throwing some error. Is it possible to use self-signed certs?

npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
npm WARN deprecated ohmyfetch@0.4.21: Package renamed to https://github.com/unjs/ofetch

> postinstall
> nuxi prepare

[4:20:55 PM] Error fetching woonuxt settings. Make sure you have the latest version woonuxt-settings plugin installed and activated WordPress. You can download it from https://github.com/scottyzen/woonuxt-settings

 ERROR                                                                                                                                                                                   4:20:56 PM
        Failed to load schema from https://intern_host:9091/graphql:

        self-signed certificate
        Error: self-signed certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1659:34)
    at TLSSocket.emit (node:events:517:28)
    at TLSSocket._finishInit (node:_tls_wrap:1070:8)
    at ssl.onhandshakedone (node:_tls_wrap:856:12)

        GraphQL Code Generator supports:
          - ES Modules and CommonJS exports (export as default or named export "schema")
          - Introspection JSON File
          - URL of GraphQL endpoint
          - Multiple files with type definitions (glob expression)
          - String in config file

        Try to use one of above options and run codegen again.

  Failed to load schema from https://intern_host:9091/graphql:

  self-signed certificate
  Error: self-signed certificate
  at TLSSocket.onConnectSecure (node:_tls_wrap:1659:34)
  at TLSSocket.emit (node:events:517:28)
  at TLSSocket._finishInit (node:_tls_wrap:1070:8)
  at ssl.onhandshakedone (node:_tls_wrap:856:12)

  GraphQL Code Generator supports:
  - ES Modules and CommonJS exports (export as default or named export "schema")
  - Introspection JSON File
  - URL of GraphQL endpoint
  - Multiple files with type definitions (glob expression)
  - String in config file

  Try to use one of above options and run codegen again.

  at executeCodegen (node_modules/@graphql-codegen/cli/esm/codegen.js:330:24)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async generate (node_modules/@graphql-codegen/cli/esm/generate-and-save.js:99:25)
  at async generate (node_modules/nuxt-graphql-client/dist/module.mjs:64:10)
  at async generateGqlTypes (node_modules/nuxt-graphql-client/dist/module.mjs:339:46)
  at async setup (node_modules/nuxt-graphql-client/dist/module.mjs:433:5)
  at async normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:2112:17)
  at async installModule (node_modules/@nuxt/kit/dist/index.mjs:2415:95)
  at async initNuxt (node_modules/nuxt/dist/index.mjs:3858:7)
  at async loadNuxt (node_modules/nuxt/dist/index.mjs:3956:5)
  at async loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:2570:19)
  at async Object.run (node_modules/nuxi/dist/chunks/prepare.mjs:56:18)
  at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1648:16)
  at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1639:11)
  at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.4fde776c.mjs:1773:7)

  Error:
  Failed to load schema from https://intern_host:9091/graphql:

  self-signed certificate
  Error: self-signed certificate
  at TLSSocket.onConnectSecure (node:_tls_wrap:1659:34)
  at TLSSocket.emit (node:events:517:28)
  at TLSSocket._finishInit (node:_tls_wrap:1070:8)
  at ssl.onhandshakedone (node:_tls_wrap:856:12)

  GraphQL Code Generator supports:
  - ES Modules and CommonJS exports (export as default or named export "schema")
  - Introspection JSON File
  - URL of GraphQL endpoint
  - Multiple files with type definitions (glob expression)
  - String in config f
AndreasMueck commented 5 months ago

A solution for local development is to disable temporarly the certificate verification:

In your terminal (macOS / Linux) set:

export NODE_TLS_REJECT_UNAUTHORIZED=0

In Windows

scottyzen commented 5 months ago

Add SSL support for local development with a self-signed certificate

Self-signed certificate #124