updated to support ssl option