0

On my local machine, my nestjs application is running on port 3000 and I have one controller with two endpoints:

@Get()
getAll() {
 return this.httpService.get('https://localhost:3000/something')
}

@Get('something')
getSomething() {
 return [1, 2, 3];
}

When I try to run the getAll endpoint, I am getting Error: unable to verify the first certificate. I understand that the issue is to do with a SSL certificate, which would probably not be an issue on a remote environment with a properly issued SSL certificate, so I am just wondering if there is a way to get around this locally?

Jacobdo
  • 1,681
  • 2
  • 18
  • 38
  • 1
    Looks like this is a duplication of https://stackoverflow.com/questions/10888610/ignore-invalid-self-signed-ssl-certificate-in-node-js-with-https-request so please try it. – Ayzrian May 10 '21 at 15:57

1 Answers1

0

If you think of doing such a thing in a real app, please don't! Instead, move all the logic to another layer (service) and then you can reuse service logic in both controller methods if you need.