nodefluent / node-sinek

:tophat: Most advanced high level Node.js Kafka client
MIT License
290 stars 52 forks source link

any way to pass `rejectUnauthorized: false` #164

Open maikelmclauflin opened 3 years ago

maikelmclauflin commented 3 years ago

title says it all. it doesn't look like this option is available. having difficulty because i am in a self signed env

rob3000 commented 3 years ago

Hi @maikelmclauflin ,

Are you able to provide some code samples so we can replicate it?

maikelmclauflin commented 3 years ago

no code anymore but got this error:

Error: self signed certificate
  at TLSSocket.onConnectSecure (_tls_wrap.js:1497:34)
  at TLSSocket.emit (events.js:315:20)
  at TLSSocket.EventEmitter.emit (domain.js:486:12)
  at TLSSocket._finishInit (_tls_wrap.js:932:8)
  at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:706:12)

i think i found that i was hitting here: https://github.com/nodefluent/node-sinek/blob/b789352fffb19b63bbe811a952fff84599608853/src/lib/kafkajs/JSConsumer.ts#L120 and saw that there was no option to allow for bypass. adding

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'

seems to have worked

maikelmclauflin commented 3 years ago

i am using basic cert setup but with different kafka image (confluent)