Updated for use with https.