The "UNABLETOVERIFYLEAFSIGNATURE" error occurs when the SSL certificate of the HTTPS resource being proxied by Webpack DevServer cannot be verified.
To resolve this error, you can either:
proxy: {
'/api': {
target: 'https://example.com',
secure: false
}
}
Note that disabling SSL verification is not recommended for production use.
proxy: {
'/api': {
target: 'https://example.com',
secure: true,
ssl: {
key: fs.readFileSync('example.crt'),
ca: fs.readFileSync('example.crt'),
cert: fs.readFileSync('example.crt')
}
}
}
Note that this method will only work if the SSL certificate is issued by a trusted Certificate Authority.
Asked: 2023-06-03 23:16:50 +0000
Seen: 10 times
Last updated: Jun 03 '23