Probably buggy SSL management code