Comments (5)
Maybe the path is wrong or Windows sucks.
PS: Windows sucks!
from node-telegram-bot-api.
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.
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.
Thanks @pedrostc, that worked for me.
from node-telegram-bot-api.
Added a note on this error in our docs!
from node-telegram-bot-api.
Related Issues (20)
- Does the API not support:Message about members leaving the group? HOT 1
- How to get call on setmenubutton ?
- Stop listening for new message events and crash app
- how to create sticker with pack, i'm new with this library so i got many error while trying
- sendMediaGroup - InputMediaDocument HOT 2
- question how to save photos by reply HOT 1
- multiple upload file HOT 1
- bot.on('message', ...) works unexpected
- Occasionally not receiving message update
- Listening for a reply to an image with the '/isimage' command, replying with a message saying 'this is an image' HOT 1
- Deleting old message IDs in Telegram
- function createInvoiceLink not exist HOT 1
- Add to sendInvoice start_parameter HOT 2
- Pre-Checkout Timeout Error while making a Payment
- The editMessageMedia method is working a bit wrong
- The 'Update' object sometimes does not have an attribute 'reply_to_message' in private messages
- Webhook setup via URL returns blank
- Business Mode HOT 4
- please help me i got this error HOT 1
- Bot replys to user no problem, but when i want it to send announchment to channel or group. nothing happens
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-telegram-bot-api.