The question is asked for testing an API. But I had a similar issue when I was trying to use GitBash in Windows and connect to Github. What helped me was:
I uninstalled the GitBash. When reinstalling, I noticed a setting regarding SSL:
I chose the second one (Use the native Windows ...) and it fixed the problem.