Diizzayy / nuxt-graphql-client

⚡️ Minimal GraphQL Client + Code Generation for Nuxt3
https://nuxt-graphql-client.web.app
MIT License
339 stars 42 forks source link

Self-signed certificate error #469

Open arnold-bernstein opened 4 months ago

arnold-bernstein commented 4 months ago

Environment

Hello, I am using woonuxt and my Graphql backend from the wordpress engine is behind a reverse proxy using an encrypted connection with a self-signed SSL. When running npm install and changing the link to my backend I recieve an error because the certificate is self-signed.

I have changed nothing in the code except for the environment pointing to my backend.

The code:

Woonuxt as published https://github.com/scottyzen/woonuxt

Describe the bug

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

Expected behaviour

Connect to my GraphQL backend without problems.

Reproduction

No response

Additional context

The bug is reported https://github.com/scottyzen/woonuxt/issues/124

Logs

No response