'L{trustRootFromCertificates} called with a single self-signed
certificate will cause L{optionsForClientTLS} to accept client
connections to a server with that certificate.'

def test_trustRootSelfSignedServerCertificate(self):

    (key, cert) = makeCertificate(O='Server    Test    Certificate', CN='server')
    selfSigned = sslverify.PrivateCertificate.fromCertificateAndKeyPair(sslverify.Certificate(cert), sslverify.KeyPair(key))
    trust = sslverify.trustRootFromCertificates([selfSigned])
    (sProto, cProto, pump) = loopbackTLSConnectionInMemory(trustRoot=trust, privateKey=selfSigned.privateKey.original, serverCertificate=selfSigned.original)
    self.assertEqual(cProto.wrappedProtocol.data, 'greetings!')
    self.assertIsNone(cProto.wrappedProtocol.lostReason)
