I tried adding the following command export NODE_TLS_REJECT_UNAUTHORIZED=0.
After that forest login is working.
But forest init is not working as expected.
I am getting the following error
forest init
(node:50849) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
× Selecting your project
× This resource is not attached to an organization, which requires you to connect without using SSO
You are probably asking a project not related to your current organization. Please, disconnect from the Forest Admin app, connect yourself with the right account that is authorized to be connected to your project, re-run forest login and forest init.
You can follow this documentation to understand how works forest init.