def test_get_peer_cert_chain(self):
    '\n        `Connection.get_peer_cert_chain` returns a list of certificates\n        which the connected server returned for the certification verification.\n        '
    chain = _create_certificate_chain()
    [(cakey, cacert), (ikey, icert), (skey, scert)] = chain
    serverContext = Context(TLSv1_METHOD)
    serverContext.use_privatekey(skey)
    serverContext.use_certificate(scert)
    serverContext.add_extra_chain_cert(icert)
    serverContext.add_extra_chain_cert(cacert)
    server = Connection(serverContext, None)
    server.set_accept_state()
    clientContext = Context(TLSv1_METHOD)
    clientContext.set_verify(VERIFY_NONE, verify_cb)
    client = Connection(clientContext, None)
    client.set_connect_state()
    interact_in_memory(client, server)
    chain = client.get_peer_cert_chain()
    assert (len(chain) == 3)
    assert ('Server Certificate' == chain[0].get_subject().CN)
    assert ('Intermediate Certificate' == chain[1].get_subject().CN)
    assert ('Authority Certificate' == chain[2].get_subject().CN)
`Connection.get_peer_cert_chain` returns a list of certificates
which the connected server returned for the certification verification.
def test_get_peer_cert_chain(self):
    '\n        `Connection.get_peer_cert_chain` returns a list of certificates\n        which the connected server returned for the certification verification.\n        '
    chain = _create_certificate_chain()
    [(cakey, cacert), (ikey, icert), (skey, scert)] = chain
    serverContext = Context(TLSv1_METHOD)
    serverContext.use_privatekey(skey)
    serverContext.use_certificate(scert)
    serverContext.add_extra_chain_cert(icert)
    serverContext.add_extra_chain_cert(cacert)
    server = Connection(serverContext, None)
    server.set_accept_state()
    clientContext = Context(TLSv1_METHOD)
    clientContext.set_verify(VERIFY_NONE, verify_cb)
    client = Connection(clientContext, None)
    client.set_connect_state()
    interact_in_memory(client, server)
    chain = client.get_peer_cert_chain()
    assert (len(chain) == 3)
    assert ('Server Certificate' == chain[0].get_subject().CN)
    assert ('Intermediate Certificate' == chain[1].get_subject().CN)
    assert ('Authority Certificate' == chain[2].get_subject().CN)