I've seen this talked everywhere but yet i couldn't find any reference to it except from Wikipedia. I've looked books such as Law and Legality in Ottoman Empire, Studies in Old Ottoman Criminal Law to Before Homosexuality in the Arab-Islamic World but nothing explicitly states that homosexuality is decriminalized or legalized, while Encyclopedia of Ottoman Empire states this:
while homosexual acts were forbidden by law, as were other forms of sexual activity such as incest and fornication, same-sex intercourse was not perceived as fundamentally unnatural and abnormal
it seems that in the mid-19th century, probably as a result of Western derision, the Ottoman elite was irritated by the way their sex and sexuality were represented to the outside world... Sufis and their quasi-erotic practices were labeled a remnant of a primitive past and pushed deeper into the collective closet. Even medical treatises, previously unambiguous about sexual practice and tendencies, were now expurgated. Explicit references to intercourse in legal codes were replaced by various euphemisms, and homoerotic poetry and art were toned down to near extinction.
For disclaimer, i don't deny that homosexuality culture in the Ottoman Empire exists and people most of the time tolerated it, but for the Ottomans to directly said in their law that homosexuality is legalized/decriminalized in times the Europeans condemned it is quite strange for me, even more with the sole reference to this is a single paper and Wikipedia pages.