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

RequestError: unable to verify the first certificate #460

Closed
QuentinCurtet opened this issue Aug 12, 2020 · 4 comments
Closed

RequestError: unable to verify the first certificate #460

QuentinCurtet opened this issue Aug 12, 2020 · 4 comments
Assignees

Comments

@QuentinCurtet
Copy link

Hello,

I'm using my own certificate authority.
Using critical@1.3.10 on Debian9, all worked correctly.
But using critical@2.0.1, i got the following error :
RequestError: unable to verify the first certificate at ClientRequest.<anonymous> (./node_modules/critical/node_modules/got/dist/source/core/index.js:891:25) at Object.onceWrapper (events.js:422:26) at ClientRequest.emit (events.js:327:22) at ClientRequest.EventEmitter.emit (domain.js:483:12) at ClientRequest.origin.emit (./node_modules/@szmarczak/http-timer/dist/source/index.js:39:20) at TLSSocket.socketErrorListener (_http_client.js:426:9) at TLSSocket.emit (events.js:315:20) at TLSSocket.EventEmitter.emit (domain.js:483:12) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at TLSSocket.onConnectSecure (_tls_wrap.js:1501:34) at TLSSocket.emit (events.js:315:20) at TLSSocket.EventEmitter.emit (domain.js:506:15) at TLSSocket._finishInit (_tls_wrap.js:936:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:710:12) at TLSWrap.callbackTrampoline (internal/async_hooks.js:120:14)

So, is it possible to configure got (the package) through critical ? If yes, how ?

Or, how is it possible to configure the path to my own certificate authority to make it work like before ?

Thanks in advance.

@bezoerb
Copy link
Collaborator

bezoerb commented Aug 12, 2020

Hey @QuentinCurtet, I think you can your the request option to configure got.

@QuentinCurtet
Copy link
Author

@bezoerb I'm not sure to understand your answer
You suggest me to install got and make the request myself ?

@bezoerb
Copy link
Collaborator

bezoerb commented Aug 13, 2020

ah, no... there's an undocumented option.

critical.generate({
   request: { /* got options */  },
   ...
})

See: https://github.com/addyosmani/critical/blob/master/src/config.js#L42 and https://github.com/addyosmani/critical/blob/master/src/file.js#L310

@QuentinCurtet
Copy link
Author

@bezoerb Can you majke a pull request to document it please ?
It works perfectly for me by the way thank you :)

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