A mufti is an Islamic scholar who is legally able to rule on various religious and personal matters. In some places, people going through a divorce might need the help of a mufti.
In Islamic countries, muftis are officials who are authorized to make legal decisions or help judges in deciding cases. Most often, they give advice about inheritance, marriage, divorce, and other civil issues. The word mufti means "judge" in Arabic. The secondary meaning of mufti is "ordinary clothes," when they're worn by people who usually wear a uniform. So a soldier wearing civilian clothes might be said to be in mufti.