Some folks requested direct download links for the 3.1.2 iPhone Software Update, see below.
iPhone2,1_3.1.2_7D11_Restore.ipsw (300+ MB)
iPhone1,2_3.1.2_7D11_Restore.ipsw (240+ MB)
iPhone1,1_3.1.2_7D11_Restore.ipsw (240+ MB)
Just in case, if you have problem during update, you can always recover your iPhone.
Note (again): If you have jailbroken your phone and you’re planing to jailbreak and unlock your iPhone in the future stay away from this update. If you like to know why, because PwnageTool and redsn0w are not yet compatible with 3.1.2
Update: Pwnage Tool 3.1.4 is compatible with 3.1.2. Visit this post for all jailbreaking and unlocking details.