[https] Fixed race condition. Related to #98.