'Specifying a chain file loads the contained certificates in the right
order.'

def test_sslChainLoads(self):

    server = endpoints.serverFromString(object(), (self.SSL_CHAIN_TEMPLATE % (escapedPEMPathName, escapedChainPathName)))
    expectedChainCerts = [Certificate.loadPEM(casPath.child(('thing%d.pem' % (n,))).getContent()) for n in [1, 2]]
    cf = server._sslContextFactory
    self.assertEqual(cf.extraCertChain[0].digest('sha1'), expectedChainCerts[0].digest('sha1'))
    self.assertEqual(cf.extraCertChain[1].digest('sha1'), expectedChainCerts[1].digest('sha1'))
