You’re thinking of Canaris, who was the head of the 3rd Reich’s equivalent of the CIA, and an anti-Nazi from the start.
It wasn’t Canaris.
He was the head of the Abwehr, German Military Intelligence. Yes, he was anti-Nazi, but he was not a communist.
The man in question’s name was Heinrich Mueller.