Giter VIP home page Giter VIP logo

Comments (5)

yagop avatar yagop commented on May 16, 2024 179

Maybe the path is wrong or Windows sucks.

PS: Windows sucks!

from node-telegram-bot-api.

pedrostc avatar pedrostc commented on May 16, 2024 30

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

from node-telegram-bot-api.

nsonankar avatar nsonankar commented on May 16, 2024 2

I am facing the same issue: PEM routines:PEM_read_bio:no start line

I have generated public key and private key by using ssh-keygen. and I am converting my public key in .pem format by using

ssh-keygen -f my_public_key_file -e -m PEM > my_new_pem_file

And I am getting my public key in PEM format in testCheckPEM file, I am updating this key in database and with the help of this public key i am trying to get encryped text, which i will use to decrypt with private key but that is next part) here is my code for encryption.
I am reading public key from database successfully and calling this function:

module.exports.encryptStringWithRsaPublicKey = (text, publicKey) => new Promise((resolve, reject) => {
try {
const buffer = new Buffer(text);
const options = { key: publicKey, padding: constants.RSA_PKCS1_PADDING };
const encrypted = crypto.publicEncrypt(options, buffer).toString('base64');
return resolve(encrypted);
} catch (ex) {
return reject(ex);
}
});

but always I am getting error 'no start line'
Error: error:0906D06C:PEM routines:PEM_read_bio:no start line

What is wrong here? Any help will be appreciated.

here is my public key in ssh-keygen format:
ssh-rsa [MIKJ........JUIIK]

And here is my public key after PEM conversion :
-----BEGIN RSA PUBLIC KEY-----
[FRTYUH........HHK\HJKK]
-----END RSA PUBLIC KEY-----

from node-telegram-bot-api.

PandaWhisperer avatar PandaWhisperer commented on May 16, 2024

Thanks @pedrostc, that worked for me.

from node-telegram-bot-api.

GochoMugo avatar GochoMugo commented on May 16, 2024

Added a note on this error in our docs!

from node-telegram-bot-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.