Skip to content

Commit

Permalink
#24 add configurable SSL certificate encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-Jensen committed Jun 29, 2019
1 parent e486994 commit a725dcf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/lnrpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const DEFAULTS = {
grpcLoader: protoLoader,
server: 'localhost:10001',
macaroonPath: '',
certEncoding: 'utf8',
tls: /^darwin/.test(process.platform) // is macOS?
? `${HOME_DIR}/Library/Application Support/Lnd/tls.cert`
: `${HOME_DIR}/.lnd/tls.cert`,
Expand Down Expand Up @@ -64,7 +65,7 @@ module.exports = async function createLnprc(config = {}) {
Convert `cert` string to Buffer
*/
if (!Buffer.isBuffer(cert)) {
cert = Buffer.from(cert);
cert = Buffer.from(cert, config.certEncoding);
}

/*
Expand Down

0 comments on commit a725dcf

Please sign in to comment.