nuxeo / nuxeo-js-client

JavaScript client library for Nuxeo API
Other
18 stars 20 forks source link

Unable to verify the first certificate #70

Closed abhisheksett closed 6 years ago

abhisheksett commented 6 years ago

I am trying to update nuxeo client for my application which was using version: 0.4.0. Once I update it to latest, I'm getting following error:

FetchError: request to https://my-intended-url failed, reason: unable to verify the first certificate at ClientRequest.req.on.err (C:\application\node_modules\node-fetch-npm\src\index.js:68:14) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:189:7) at TLSSocket.socketErrorListener (_http_client.js:358:9) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:189:7) at emitErrorNT (net.js:1280:8) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)

How to resolve this issue?

Note: for my development I'm using http://localhost which is pointing to https://url as base url and the base url is having valid certificate and I'm using method 'portal' with username and secret. This config working fine with version 0.4.0

troger commented 6 years ago

Hi,

This is not an issue related to the JS client but to Node.js when using a self-signed cert. Here are some links that may help you: https://github.com/aspnet/JavaScriptServices/issues/1089#issuecomment-313070923 https://www.npmjs.com/package/ssl-root-cas https://stackoverflow.com/a/32440021/7807540

abhisheksett commented 6 years ago

I can understand that's a node issue. My question is, is there anyway by which I can set parameter in client which will disable strict ssl check or disable rejectUnauthorized? I feel there is some issue with intermediate certificate, but I just want to allow my requests. Is there any way nuxeo allows that?