Sign up/in using google account for localhost application
===

I want to use "sign up/in using google account" on my localhost web application. I used the apis provided by google for this. But its not working. it gives me an error 

HTTP Error: (0) couldn't connect to host

Is it necessary to have a security certificate (SSL) for localhostto use these api?

What can be the problem?