copied to local for ssl support