added ssl support