elastic / makelogs

109 stars 44 forks source link

There is an error "Unable to load PFX certificate" when connecting the aws elasticsearch. #53

Open heungh opened 3 years ago

heungh commented 3 years ago

I tested with my ec2 and aws elasticsearch but got the errors. How can I gernerate logs without an error below?

makelogs - url https://search-xxxxx-es-fd5uuxxxxx3dvjjshurlfuwn4fq.ap-northeast-2.es.amazonaws.com/

node:internal/tls/secure-context:278 context.loadPKCS12(toBuf(pfx)); ^

Error: Unable to load PFX certificate at configSecureContext (node:internal/tls/secure-context:278:15) at Object.createSecureContext (node:_tls_common:116:3) at Object.connect (node:_tls_wrap:1613:48) at HttpsAgent.createConnection (node:https:143:22) at HttpsAgent.createSocket (/home/ec2-user/.nvm/versions/node/v16.5.0/lib/node_modules/@elastic/makelogs/node_modules/agentkeepalive/lib/_http_agent.js:265:26) at HttpsAgent.createSocket (/home/ec2-user/.nvm/versions/node/v16.5.0/lib/node_modules/@elastic/makelogs/node_modules/agentkeepalive/lib/agent.js:77:11) at HttpsAgent.addRequest (/home/ec2-user/.nvm/versions/node/v16.5.0/lib/node_modules/@elastic/makelogs/node_modules/agentkeepalive/lib/_http_agent.js:239:10) at new ClientRequest (node:_http_client:305:16) at Object.request (node:https:353:10) at HttpConnector.request (/home/ec2-user/.nvm/versions/node/v16.5.0/lib/node_modules/@elastic/makelogs/node_modules/elasticsearch/src/lib/connectors/http.js:182:23) { code: 'ERR_CRYPTO_OPERATION_FAILED' }

rafaelvzago commented 1 year ago

I wanted to recommend this pull request https://github.com/elastic/makelogs/pull/58 as it addresses the issue of not being able to run the mock. I personally faced this issue as well and this PR allowed me to successfully run the mock. It would be great if it could be reviewed and merged.