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

ERROR EUNAVAILABLE for self signed certificate #132

Open
qaniel opened this issue Feb 27, 2020 · 1 comment
Open

ERROR EUNAVAILABLE for self signed certificate #132

qaniel opened this issue Feb 27, 2020 · 1 comment

Comments

@qaniel
Copy link

qaniel commented Feb 27, 2020

When trying to connect to an internal identity server for OAuth authentication using https (self-signed) the library gives a misleading error of EUNAVAILABLE. popsicle version 12.0.4

{
  "request" : {
    "trailer" : {

    },
    "$rawBody" : "scope=SCOPE&grant_type=GRANT_TYPE",
    "method" : "POST",
    "url" : "https://domain.com/connect/token",
    "signal" : {
      "_" : [

      ],
      "$" : {
        "abort" : [
          null,
          null,
          null
        ]
      },
      "aborted" : false
    },
    "headers" : {
      "object" : {
        "user-agent" : "Popsicle (https://github.com/serviejs/popsicle)",
        "accept" : "application/json, application/x-www-form-urlencoded",
        "content-type" : "application/x-www-form-urlencoded",
        "authorization" : "Basic AUTH_CODE",
        "content-length" : "41",
        "accept-encoding" : "gzip, deflate, br"
      }
    }
  },
  "stack" : "ConnectionError: Unable to connect to domain.com:443\n    at TLSSocket.onError (/var/www/html/project/node_modules/popsicle-transport-http/src/index.ts:706:15)\n    at Object.onceWrapper (events.js:418:26)\n    at TLSSocket.emit (events.js:311:20)\n    at emitErrorNT (internal/streams/destroy.js:92:8)\n    at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)\n    at processTicksAndRejections (internal/process/task_queues.js:84:21)",
  "code" : "EUNAVAILABLE"
} 

Note that I'm able to wget https://domain.com:443 --no-check-certificate and receive a successful response. Also, it works when using regular Http

@blakeembrey
Copy link
Member

That’s reasonable. Is this bug report that the error should be improved? There’s an option already that allows you to connect to self signed certificates in the transport layer.

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

2 participants