fixing bug in writing tmp ssl data