question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: error:0906D06C:PEM routines:PEM_read_bio:no start line

See original GitHub issue

Hello.

I have created crt and key files by using openssl as suggested here https://github.com/yagop/node-telegram-bot-api#webhooks

Then I wrote this code https://github.com/yagop/node-telegram-bot-api/blob/master/examples/httpsWebHook.js

And when I try to start it throws me this error:

 _tls_common.js:65
       c.context.setCert(options.cert);
                      ^

 Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
    at Error (native)
    at Object.createSecureContext (_tls_common.js:65:17)
    at Server (_tls_wrap.js:754:25)
    at new Server (https.js:24:14)
    at Object.exports.createServer (https.js:44:10)
    at new TelegramBotWebHook (d:\Phantasy  star\Mobi\Daniars_Project\Node\bot\node_modules\node-telegram-bot-api\src\telegramWebHook.js:23:29)
    at new TelegramBot (d:\Phantasy star\Mobi\Daniars_Project\Node\bot\node_modules\node-telegram-bot-api\src\telegram.js:54:21)
    at Object.<anonymous> (d:\Phantasy star\Mobi\Daniars_Project\Node\bot\main.js:19:11)
    at Module._compile (module.js:397:26)
    at Object.Module._extensions..js (module.js:404:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:429:10)
    at startup (node.js:139:18)
    at node.js:999:3

I have changed encoding of these files to UTF-8 and this does not work

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

178reactions
yagopcommented, Jan 30, 2016

Maybe the path is wrong or Windows sucks.

PS: Windows sucks!

29reactions
pedrostccommented, Apr 8, 2016

I was having the same problem but on a ubuntu server. The solution was generate the certificates using the following commands:

openssl req -newkey rsa:2048 -new -nodes -keyout key.pem -out csr.pem
openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out server.crt

found it here : http://stackoverflow.com/questions/22584268/node-js-https-pem-error-routinespem-read-biono-start-line

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenSSL: PEM routines:PEM_read_bio:no start line:pem_lib ...
Please, provide the solution. P.S.: The message unable to load certificate 140603809879880:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c ...
Read more >
How to fix "PEM_read_bio:no start line error" nginx error
[emerg]: SSL_CTX_use_PrivateKey_file("/etc/ssl/cert.pem") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line error:140B0009:SSL ...
Read more >
error:0906D06C:PEM routines:PEM_read_bio:no start line #409
Detailed Error: I am manually giving the private key to the new BoxSDK( ) instance. I have generated the key from the Box-developer...
Read more >
Error 0906D06C:PEM routines:PEM_read_bio:no start line ...
Description Configuration does not load when upgrading to 11.6.5.2. Next error is prompted after some minutes of a failing configuration loading ...
Read more >
Error:0906D06C:PEM routines:PEM_read_bio:no start line
I have PFX Client certificate, I have import in Postman & It works absolutely fine. But while I'm trying with command line &...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found