President Trump doesn’t have much in the way of kind words for the transatlantic alliance. As a candidate, Trump called NATO “obsolete.” As president, he has reportedly asked aides why the United States should not abandon it.

The reality, though, is that NATO is thriving. Funding for the U.S. military presence in Europe is increasing. NATO has put combat-ready multinational battle groups into the Baltic republics and Poland. It has a new cyberspace operations center in Belgium. Despite transatlantic fights on trade, climate change and the Iran nuclear deal, Europe and the United States agree that Russia’s Vladimir Putin is a menace and they are rising to the challenge.

The same cannot be said on China. This week, Britain, traditionally the European ally most in sync with the Pentagon, reportedly brushed off threats from Washington by deciding to build parts of its fifth-generation (or 5G) wireless network with equipment from the Chinese telecom giant, Huawei. Vice President Pence and Secretary of State Mike Pompeo had urged allies to shun Huawei, suggesting that the United States would not be able to share intelligence with countries that compromised network security by buying Chinese gear. Britain has said boo to them.

This British defiance follows a European pattern. Huawei has conducted 5G trials in Belgium, Finland, France, Germany, Italy, Norway, Spain, Switzerland and Turkey. Last month, Italy laid out the red carpet for President Xi Jinping and a 500-strong group, becoming the first Group of Seven nation to endorse China’s global influence-buying program known as the Belt and Road Initiative. During Barack Obama’s presidency, the United States urged European allies to boycott the Chinese-led Asian Infrastructure Investment Bank. Germany, France, Britain, Italy and more than a dozen smaller European states ignored U.S. pressure.

It’s easy to see why transatlantic solidarity against Russia is not matched by a common China policy. Since the annexation of Crimea, Putin has posed an obvious threat to his European neighbors; in contrast, China’s habit of threatening Taiwan and turning rocky islands into fortresses seems abstract in Berlin or Paris. Since the loss of empire, Europeans have grown used to not being the global hegemons. In the United States, the fact that China will have the world’s largest economy within a few years feels altogether more disturbing.

Unsurprising though it may be, this Western division over China needs to be fixed urgently. The biggest threat to liberal democracies is not stagnant economies, inequality or populism. It is that the world’s new superpower is hostile to liberal values. China’s leaders are growing more autocratic domestically, more assertive internationally and more accomplished at marshaling technology to augment state power. In the near term, Russia’s swaggering strongman may be the West’s most troublesome adversary. In the longer run, China’s patient dictatocrats present the more profound challenge.

To forge a common front on China, the United States must become less arrogant. China, unlike the Soviet Union of old, is deeply integrated into the global economy. It is therefore unrealistic for the United States to demand that Europe cut commercial ties with Chinese companies such as Huawei. The Trump administration has run this experiment. It has only exposed the limits to its influence.

Europe, for its part, must become less supine. The continent’s business and policy leaders sometimes insinuate that the Trump administration’s hostility to Huawei merely reflects the commercial interests of the U.S. tech lobby. They don’t reckon with the fact that, when 5G-enabled autonomous vehicles become commonplace on Western streets, a foreign power that hacks the network could turn those vehicles into deadly weapons. The Chinese state requires its companies to collaborate with it on national security. A network built on Chinese gear is obviously less safe than one built on Western gadgetry.

There is a middle way, and it starts with the Trump administration fixing its own errors. Huawei is the dominant supplier of 5G equipment partly because the United States is marginalizing itself — it is set on building its network using a different part of the spectrum than that favored in other countries. Next, rather than wishfully demanding a Europe free of Huawei, the administration should focus on managing the world as it is. It should call for continuous testing and monitoring of network equipment to track down vulnerabilities. It should consider whether some parts of 5G networks are more sensitive than others. (Confusingly, experts disagree on this.) Perhaps most significant, it should insist on robust encryption of applications that run on the network. To analogize: If the 5G highway cannot be rendered totally secure, you had better navigate it in an armored vehicle.

If this week’s reports are right, the decision by Britain’s National Security Council points toward this compromise. Britain apparently plans to use Huawei’s gear only outside the “core” of its network. Its cyberdefense agency has been monitoring Huawei’s equipment in the existing 4G network and has sometimes lambasted the company for supplying slipshod code; it will continue to play hardball in the future. This amounts to the sort of pragmatic arrangement that the Trump administration should welcome. So far it has not done so.

Read more: