[WO-593] fix starttls control flow