He has also been convicted of possessing explosives, after dozens of his fingerprints were found on bomb components recovered by US forces in Afghanistan.
His trial at the Old Bailey heard how Ali, also a qualified gas-fitter, had been under surveillance by MI5 after returning from Afghanistan in late 2016.
He had spent more than five years helping construct hundreds of bombs for the Taliban.
Following his return to the UK, an intelligence database cross matched his fingerprints with 42 separate prints found on dozens of improvised explosive device components.
As police and the security services began preparing a criminal case against Ali, he was being monitored by authorities, when it became clear he was about to launch an attack.
Deputy assistant commissioner Dean Haydon, head of counter terror policing in the UK, said Ali was a "highly dangerous individual".
"We were trying to understand what he was up to here and trying to get the evidence from international partners we could use in court, when we became pretty convinced that he'd rearmed himself with knives," he said.
His arrest in April last year came just a month after terrorist Khalid Masood killed pedestrians on Westminster bridge, before fatally stabbing PC Keith Palmer outside the Houses of Parliament.
SKY News.