added ssl support
made http and https optional, use one or both