If you are having trouble downloading the software (including iOS 12) for your iPhone via iTunes, you should find this article quite helpful. We have outlined a few solutions that may help with the problem. Try again after each one and we hope you can overcome this error.
5 Tips to Fix Problem of Downloading the Software for iPhone
1 Uninstall Third-Party Security Software
It is likely that the third-party security software on your computer could be messing with the whole process by preventing iTunes or your device from connecting with the Apple Servers. This is especially true if you are using a Windows computer. Uninstall or disable the security software and then try again.
2 Check that Your Firewall Is not Blocking Apple
It is also absolutely possible that your firewall is blocking Apple servers from communicating with your computer. If you have firewall, check that albert.apple.com or phobos.apple.com is not blocked. While you are at it check that your internet settings are not blocking Apple and verify that ports 80 and 443 are allowed on your network.
3 Discard the .ipsw File and Download Again
Discarding the .ipsw file and attempting to download it again may fix the issue. To delete the file follow these simple steps.
Step 1: Go to the Finder on your Mac and hold down the Option key on the keyboard.
Step 2: Select the "Go" menu and then click on "Library" which is often invisible unless you hold down the Option Key.
Step 3: Find the iTunes folder and look for iPad Software Updates, iPhone Software Updates and iPod Software Updates.
Step 4: Find the filename that ends with "Restore.ipsw" and delete it.
Now attempt the download again and see if it works.
4 Connect To A Different Network
Since this is usually a network related issue, simply connecting the computer to a different network may fix the problem. You may also want to try restoring the device using a different computer if you have more than one.
If none of the above solutions work, contact Apple support for more options.
5 Reset Internet Protocol (TCP/IP)
Sometimes third-party software can alter the default packet size in Windows by adding a TcpWindowSize entry in your registry. Resetting the Internet protocol can help. You can do this automatically on the Microsoft websites by downloading the troubleshooting solution. The help article HERE, also details how you can do it manually.