diff --git a/lib/endpoints.js b/lib/endpoints.js index c41d212..e3bc321 100644 --- a/lib/endpoints.js +++ b/lib/endpoints.js @@ -26,10 +26,20 @@ class Endpoints { }) try { - this.agent = new https.Agent({ - pfx: fs.readFileSync(this.options.certificate), - passphrase: '', - }) + + if(this.options.pemKey){ + this.agent = new https.Agent({ + cert: fs.readFileSync(this.options.certificate), + key: fs.readFileSync(this.options.pemKey), + passphrase: '' + }) + }else{ + this.agent = new https.Agent({ + pfx: fs.readFileSync(this.options.certificate), + passphrase: '', + }) + } + this.options.agent = this.agent } catch (error) { diff --git a/package.json b/package.json index 0a7fe33..2de6087 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gn-api-sdk-node", "description": "Module for integration with Gerencianet API", - "version": "3.0.3", + "version": "3.0.4", "author": "Gerencianet - Consultoria Tecnica | Palloma Brito | João Vitor Oliveira", "license": "MIT", "repository": "gerencianet/gn-api-sdk-node",