If you want to manually download version 4.0.1, here are the links.
iPhone 3G – iPhone1,2_4.0.1_8A306_Restore.ipsw
iPhone 3GS – iPhone2,1_4.0.1_8A306_Restore.ipsw
iPhone 4 – iPhone3,1_4.0.1_8A306_Restore.ipsw
If you want to manually download version 4.0.1, here are the links.
iPhone 3G – iPhone1,2_4.0.1_8A306_Restore.ipsw
iPhone 3GS – iPhone2,1_4.0.1_8A306_Restore.ipsw
iPhone 4 – iPhone3,1_4.0.1_8A306_Restore.ipsw