Added support for https and oauth