简体   繁体   中英

Error: unable to verify the first certificate in Nestjs

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM