Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.
This repository was archived by the owner on Apr 23, 2024. It is now read-only.

Erro ao acessar ws sefaz #44

@juniorschroder

Description

@juniorschroder

alguem tem alguma ideia?

Error: unable to get local issuer certificate
at TLSSocket.onConnectSecure (_tls_wrap.js:1497:34)
at TLSSocket.emit (events.js:315:20)
at TLSSocket._finishInit (_tls_wrap.js:932:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:706:12) {
code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
}

Estou usando certificado pfx... ja tentei tmb exportar pra pem e key ... mesmo erro.
cadeia de certificados raiz instalada na maquina.

node v14.16.1, macOS

teste realizado:

let cert = {
key: null,
pem: null,
pfx: fs.readFileSync('/Users/juniorschroder/Downloads/xxxx.pfx'),
password: 'xxxx'
};

let dadosEmpresa: Empresa = {
razaoSocial: 'TESTE',
nomeFantasia: 'TEST',
cnpj: '',
CNAE: '',
inscricaoEstadual: '',
inscricaoMunicipal: '',
inscricaoEstadualST: '',
codRegimeTributario: '3',
endereco: {
logradouro: 'Rua Teste',
numero: '123',
complemento: '',
bairro: 'Bairro Teste',
municipio: 'Cachoeirinha',
codMunicipio: '4303004',
uf: 'RS',
cUf: '43',
cep: '99999999',
telefone: '999999999',
codPais: '1058',
pais: 'BRASIL'
},
certificado: cert,
idCSC: '1',
CSC: ''
};

const status = new StatusServicoProcessor(dadosEmpresa, "2", "55");

const retorno = await status.consultarStatusServico(status.gerarXmlStatusServico("1.07", "2", "43"), cert);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions