Merged in development (pull request #12)
feat: parse certificado from base64 string
This commit is contained in:
commit
8d12ae5c9e
3 changed files with 5 additions and 5 deletions
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "lhisp-oauth-client",
|
||||
"version": "1.0.16",
|
||||
"version": "1.0.17",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "lhisp-oauth-client",
|
||||
"version": "1.0.16",
|
||||
"version": "1.0.17",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^1.4.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "lhisp-oauth-client",
|
||||
"version": "1.0.16",
|
||||
"version": "1.0.17",
|
||||
"main": "src/index",
|
||||
"types": "src/index.d.ts",
|
||||
"repository": "git@bitbucket.org:leandro_costa/lhisp-oauth-client.git",
|
||||
|
|
|
@ -21,7 +21,7 @@ export class LhispOauthClient<iAccessToken extends AccessToken = AccessToken> {
|
|||
protected authHeaderName: string;
|
||||
protected tokenHeaderName: string;
|
||||
protected authContentType: ContentType;
|
||||
protected certificado?: string;
|
||||
protected certificado?: string | Buffer;
|
||||
protected senhaCertificado?: string;
|
||||
protected authScope?: string;
|
||||
protected headers?: Headers;
|
||||
|
@ -36,7 +36,7 @@ export class LhispOauthClient<iAccessToken extends AccessToken = AccessToken> {
|
|||
constructor(params: LhispOauthClientConstructorParams) {
|
||||
if (params.certificado) {
|
||||
this.agent = new https.Agent({
|
||||
pfx: params.certificado,
|
||||
pfx: Buffer.isBuffer(params.certificado) ? params.certificado : Buffer.from(params.certificado, "base64"),
|
||||
passphrase: params.senhaCertificado,
|
||||
rejectUnauthorized: false,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue