بسم الله الرحمن الرحيم
According to all righteous Ulama-e-Haq the four maslaks are true. Hence it is not lawful for you to change your maslak from Shafai to Hanafi due to your husband or your in-laws, rather some scholars have termed this a cause of bad consequence. Hence you should avoid changing your maslak. It is not lawful for you to follow your husband or your in-laws in this case; rather it is wajib to avoid such things.
كذا فى الدر والرد (كتاب الحدود فصل فى التعزير 6:132-133 وكتاب الشهادات باب القبول و عدمه 8:200 ط مكتبه زكريا ديوبند)
Allah knows Best!
Darul Uloom Deoband