Sahih Muslim Book 23, Hadith Number 4892.

Chapter : It is forbidden to use wine as a medicine.

Wa’il al-Hadrami reported that Tariq b. Suwaid a-Ju’fi asked Allah’s Apostle (may peace be upon him) about liquor. He forbade (its use) and he expressed hatred that it should be prepared. He (Tariq) said: I prepare it as a medicine, whereupon he (the Holy Prophet) said: It is no medicine, but an ailment.