Question: In some hospitals nowadays, they use test tubes for birth, that is they take the sperm from a man through a test tube and place it inside the wife. That is because some women cannot give birth or when there is difficulty in giving birth. Is this action permissible?
Answer: “if it is verified that this [sperm] is from the man and this [egg] is from the woman, and there is no [sperm] from another man or an [egg] from another woman, then it is allowed. However, there is an existing doubt because it is possible to take the sperm from another man and put it in this test tube and then the child is born from this. So what is more deserving is to avoid it, abandon it, and instead rely upon Allah, the Exalted and ask him to give a person what he wants without using these means. This is because there is doubt in this issue in that the sperm can come from a man who is her husband or it could be from another man, especially with the lack of trust [found] in many people. And Allah knows best”.
[Sharh Sunan Abu Dawood no. 56]
Faisal Ibn Abdul Qaadir Ibn Hassan