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

Cannot read property _getEncoder of undefined when parsing staging letsencrypt certs #16

Closed
Rush opened this issue Sep 20, 2016 · 8 comments

Comments

@Rush
Copy link

Rush commented Sep 20, 2016

Ideas?

Sep 20 23:58:46 dragon node[25459]: [2] [Uncaught exception] TypeError: Cannot read property '_getEncoder' of undefined
Sep 20 23:58:46 dragon node[25459]: at DERNode.use [as _use] (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/encoders/der.js:244:16)
Sep 20 23:58:46 dragon node[25459]: at DERNode._getUse (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:431:27)
Sep 20 23:58:46 dragon node[25459]: at DERNode.encode [as _encodeValue] (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:560:21)
Sep 20 23:58:46 dragon node[25459]: at DERNode.encode [as _encode] (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:482:21)
Sep 20 23:58:46 dragon node[25459]: at DERNode.<anonymous> (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:535:23)
Sep 20 23:58:46 dragon node[25459]: at Array.map (native)
Sep 20 23:58:46 dragon node[25459]: at DERNode.encode [as _encodeValue] (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:524:30)
Sep 20 23:58:46 dragon node[25459]: at DERNode.encode [as _encode] (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:482:21)
Sep 20 23:58:46 dragon node[25459]: at DERNode.encode [as _encodeValue] (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:560:48)
Sep 20 23:58:46 dragon node[25459]: at DERNode.encode [as _encode] (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:482:21)
Sep 20 23:58:46 dragon node[25459]: at DERNode.<anonymous> (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:535:23)
Sep 20 23:58:46 dragon node[25459]: at Array.map (native)
Sep 20 23:58:46 dragon node[25459]: at DERNode.encode [as _encodeValue] (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:524:30)
Sep 20 23:58:46 dragon node[25459]: at DERNode.encode [as _encode] (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:482:21)
Sep 20 23:58:46 dragon node[25459]: at DERNode.encode [as _encodeValue] (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:497:30)
Sep 20 23:58:46 dragon node[25459]: at DERNode.encode [as _encode] (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/base/node.js:482:21)
Sep 20 23:58:46 dragon node[25459]: at OCSPRequest.encode (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/encoders/der.js:22:20)
Sep 20 23:58:46 dragon node[25459]: at Entity.encode (/usr/local/node/lib/node_modules/http-master/node_modules/asn1.js/lib/asn1/api.js:60:32)
Sep 20 23:58:46 dragon node[25459]: at Object.generate (/usr/local/node/lib/node_modules/http-master/node_modules/ocsp/lib/ocsp/request.js:63:31)
Sep 20 23:58:46 dragon node[25459]: at /usr/local/node/lib/node_modules/http-master/src/HttpMasterWorker.js:258:32
Sep 20 23:58:46 dragon node[25459]: at Object.getAuthorityInfo (/usr/local/node/lib/node_modules/http-master/node_modules/ocsp/lib/ocsp/utils.js:168:10)
Sep 20 23:58:46 dragon node[25459]: at Object.getOCSPURI (/usr/local/node/lib/node_modules/http-master/node_modules/ocsp/lib/ocsp/api.js:13:14)
Sep 20 23:58:46 dragon node[25459]: at Server.<anonymous> (/usr/local/node/lib/node_modules/http-master/src/HttpMasterWorker.js:250:12)
Sep 20 23:58:46 dragon node[25459]: at emitThree (events.js:116:13)
Sep 20 23:58:46 dragon node[25459]: at Server.emit (events.js:194:7)
Sep 20 23:58:46 dragon node[25459]: at Server.emit (/usr/local/node/lib/node_modules/http-master/node_modules/spdy/lib/spdy/server.js:218:40)
Sep 20 23:58:46 dragon node[25459]: at requestOCSP (_tls_wrap.js:123:17)
@Rush Rush changed the title Cannot read property _getEncoder of undefined Cannot read property _getEncoder of undefined when parsing staging letsencrypt certs Sep 20, 2016
@Rush
Copy link
Author

Rush commented Sep 20, 2016

Updated title. It happens when testing staging letsencrypt certificates.

@indutny
Copy link
Owner

indutny commented Sep 21, 2016

Hello!

Is there any way to reproduce this issue?

@Rush
Copy link
Author

Rush commented Sep 21, 2016

I just tried and I cannot reproduce it for some reason. Maybe there was a streak of "bad" certificates, unfortunately (stupid me) I purged that staging dir.

However we can point out one problem with node-ocsp that could make it better:

let ocsp = require('ocsp');
try {
  ocsp.getOCSPURI('', function(err, uri) {
    console.log('err should be here', err);
  });
} catch(err) {
  console.log('but it is here', err);
}

This throws a sync exception and I believe the exception should be async if the interface is indeed async.

@indutny
Copy link
Owner

indutny commented Sep 23, 2016

I think I have managed to reproduce the issue. Please consider running npm update, it should be fixed now.

@indutny
Copy link
Owner

indutny commented Sep 23, 2016

Please open an issue for API thing separately ;)

@indutny indutny closed this as completed Sep 23, 2016
@lionello
Copy link

lionello commented Nov 1, 2016

This error is still happening with latest from master when running npm test. Disappears when I comment out the line with revocationReason in server-test.js

@indutny
Copy link
Owner

indutny commented Nov 4, 2016

@lionello which node.js version are you using? Could you please gist output of npm list?

@lionello
Copy link

lionello commented Nov 7, 2016

https://gist.github.com/lionello/e51c0b66a4db2686dadad8db37dcf551

Check npm test output in my comment for the GIST.

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

3 participants