No historian can claim to know that. That can be a statement of faith, not a historical one.
Celsus specifically claims that Mary was
a poor woman of the country, who gained her subsistence by spinning, and who was turned out of doors by her husband, a carpenter by trade, because she was convicted of adultery; that after being driven away by her husband, and wandering about for a time, she disgracefully gave birth to Jesus, an illegitimate child
If Mary was suspected of adultery, but not convicted because Joseph although certain of her guilt (he knew he had not known her, the public did not know that) connived at her adultery and declined to bring charges or to turn her out, did this legally turn Jesus a "mamzer" under Jewish laws?