1

I am trying to build a sistem that looks for my security camera's emails and turn lights on and off in the house with the smartthing API, but when I run the basic example code just to get the emails I get the error that I have a self signed certificate.

My code

var POP3Client = require("mailpop3");
var client = new POP3Client(995, "pop.gmail.com", {
  tlserrs: false,
  enabletls: true,
  debug: false,
});

client.on("error", function (err) {
  if (err.errno === 111) console.log("Unable to connect to server");
  else console.log("Server error occurred");
  console.log(err);
});

client.on("connect", function () {
  console.log("CONNECT success");
  client.login("email", "pas");
});

I've tried like 10 youtube videos made by some indian guy and even chat-gpt but all of them didn't work...

Server error occurred

Error: self-signed certificate at TLSSocket.onConnectSecure (node:_tls_wrap:1540:34) at TLSSocket.emit (node:events:513:28) at TLSSocket._finishInit (node:_tls_wrap:959:8) at ssl.onhandshakedone (node:_tls_wrap:743:12) { code: 'DEPTH_ZERO_SELF_SIGNED_CERT' }

Mahesh Thorat
  • 1
  • 4
  • 11
  • 22
  • Hey did you check this question? https://stackoverflow.com/questions/23601989/client-certificate-validation-on-server-side-depth-zero-self-signed-cert-error – PavanDevarakonda May 14 '23 at 15:09

0 Answers0