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:0906D066:PEM routines:PEM_read_bio:bad end line #1

Closed
emadd opened this issue Apr 22, 2014 · 4 comments
Closed

error:0906D066:PEM routines:PEM_read_bio:bad end line #1

emadd opened this issue Apr 22, 2014 · 4 comments
Labels

Comments

@emadd
Copy link

emadd commented Apr 22, 2014

Any idea why I'm getting this error at random?

TypeError: error:0906D066:PEM routines:PEM_read_bio:bad end line
    at Object.push.generatePackage (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/safari-push-notifications/index.js:53:26)
    at module.exports.apnGetPushPackage (/Users/erikmadsen/Documents/Projects/Quiver/server/controllers/notification.js:200:33)
    at callbacks (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/express.io/node_modules/express/lib/router/index.js:164:37)
    at ensureAuthorized (/Users/erikmadsen/Documents/Projects/Quiver/server/routes.js:467:12)
    at callbacks (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/express.io/node_modules/express/lib/router/index.js:164:37)
    at param (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/express.io/node_modules/express/lib/router/index.js:138:11)
    at pass (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/express.io/node_modules/express/lib/router/index.js:145:5)
    at Router._dispatch (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/express.io/node_modules/express/lib/router/index.js:173:5)
    at Object.router (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/express.io/node_modules/express/lib/router/index.js:33:10)
    at next (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/express.io/node_modules/express/node_modules/connect/lib/proto.js:193:15)
    at Object.handle (/Users/erikmadsen/Documents/Projects/Quiver/config/express.js:52:13)
    at Context.next (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/express.io/node_modules/express/node_modules/connect/lib/proto.js:193:15)
    at Context.actions.pass (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/passport/lib/passport/context/http/actions.js:77:8)
    at /Users/erikmadsen/Documents/Projects/Quiver/node_modules/passport/lib/passport/strategies/session.js:61:12
    at pass (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/passport/lib/passport/index.js:321:31)
    at /Users/erikmadsen/Documents/Projects/Quiver/node_modules/passport/lib/passport/index.js:332:35
    at null.<anonymous> (/Users/erikmadsen/Documents/Projects/Quiver/config/passport.js:28:32)
    at EventEmitter.emit (events.js:95:17)
    at module.exports.CustomEventEmitter.emit (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/sequelize/lib/emitters/custom-event-emitter.js:61:33)
    at null.<anonymous> (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/sequelize/lib/query-interface.js:974:19)
    at EventEmitter.emit (events.js:95:17)
    at module.exports.CustomEventEmitter.emit (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/sequelize/lib/emitters/custom-event-emitter.js:61:33)
    at null.<anonymous> (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/sequelize/lib/emitters/custom-event-emitter.js:131:17)
    at EventEmitter.emit (events.js:117:20)
    at module.exports.CustomEventEmitter.emit (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/sequelize/lib/emitters/custom-event-emitter.js:61:33)
    at module.exports.onSuccess (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/sequelize/lib/dialects/postgres/query.js:131:14)
    at null.<anonymous> (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/sequelize/lib/dialects/postgres/query.js:52:17)
    at EventEmitter.emit (events.js:95:17)
    at Query.handleReadyForQuery (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/pg/lib/query.js:84:8)
    at null.<anonymous> (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/pg/lib/client.js:159:19)
    at EventEmitter.emit (events.js:117:20)
    at Socket.<anonymous> (/Users/erikmadsen/Documents/Projects/Quiver/node_modules/pg/lib/connection.js:105:12)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:746:14)
    at Socket.EventEmitter.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:408:10)
    at emitReadable (_stream_readable.js:404:5)
    at readableAddChunk (_stream_readable.js:165:9)
    at Socket.Readable.push (_stream_readable.js:127:10)
    at TCP.onread (net.js:526:21)
@kobim
Copy link
Member

kobim commented Apr 22, 2014

Hi @emadd, verify your PEM file is in the format of:

-----BEGIN CERTIFICATE-----
XXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXX
....
-----END CERTIFICATE-----

Note there are 5 hyphens before and after the texts, and verify your file does end only with -----END CERTIFICATE-----.

You can also try to check it via command line with openssl (valid output will be something that is not unable to load certificate): openssl x509 -in CERT -text -noout

@emadd
Copy link
Author

emadd commented Apr 22, 2014

It is. It works more often than not, but randomly throws that exception

On Apr 22, 2014, at 1:01 AM, Kobi Meirson notifications@github.com wrote:

Hi @emadd, verify your PEM file is in the format of:

-----BEGIN CERTIFICATE-----
XXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXX
....
-----END CERTIFICATE-----
Note there are 5 hyphens before and after the texts, and verify your file does end only with -----END CERTIFICATE-----.

You can also try to check it via command line with openssl (valid output will be something that is not unable to load certificate): openssl x509 -in CERT -text -noout


Reply to this email directly or view it on GitHub.

@kobim
Copy link
Member

kobim commented Apr 22, 2014

Do you always read the certificate file, or you save and reuse it ?

@emadd
Copy link
Author

emadd commented Apr 22, 2014

My bad. I actually got confused between iOS APNs and Safari… had my app configured to use a different certificate and key in production.

On Apr 22, 2014, at 1:33 AM, Kobi Meirson notifications@github.com wrote:

Do you always read the certificate file, or you save and reuse it ?


Reply to this email directly or view it on GitHub.

@kobim kobim closed this as completed Apr 22, 2014
@kobim kobim added the invalid label May 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants