def test_ellipticCurveDiffieHellman(self):
        """
        Connections use ECDH when OpenSSL supports it.
        """
        if not get_elliptic_curves():
            raise unittest.SkipTest("OpenSSL does not support ECDH.")

        onData = defer.Deferred()
        # TLS 1.3 cipher suites do not specify the key exchange
        # mechanism:
        # https://wiki.openssl.org/index.php/TLS1.3#Differences_with_TLS1.2_and_below
        #
        # and OpenSSL only supports ECHDE groups with TLS 1.3:
        # https://wiki.openssl.org/index.php/TLS1.3#Groups
        #
        # so TLS 1.3 implies ECDHE.  Force this test to use TLS 1.2 to
        # ensure ECDH is selected when it might not be.
        self.loopback(
            sslverify.OpenSSLCertificateOptions(
                privateKey=self.sKey,
                certificate=self.sCert,
                requireCertificate=False,
                lowerMaximumSecurityTo=sslverify.TLSVersion.TLSv1_2
            ),
            sslverify.OpenSSLCertificateOptions(
                requireCertificate=False,
                lowerMaximumSecurityTo=sslverify.TLSVersion.TLSv1_2,
            ),
            onData=onData,
        )

        @onData.addCallback
        def assertECDH(_):
            self.assertEqual(len(self.clientConn.factory.protocols), 1)
            [clientProtocol] = self.clientConn.factory.protocols
            cipher = clientProtocol.getHandle().get_cipher_name()
            self.assertIn(u"ECDH", cipher)

        return onData

        Connections use ECDH when OpenSSL supports it.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_sslverify.py