[tor-commits] [ooni-probe/master] Add Sphinx docstring for getPeerCert() function.

art at torproject.org art at torproject.org
Tue Apr 30 13:01:44 UTC 2013


commit a550f38e1b79a924b3c6e636a3bf5464130b6382
Author: Isis Lovecruft <isis at torproject.org>
Date:   Mon Apr 22 00:46:42 2013 +0000

    Add Sphinx docstring for getPeerCert() function.
---
 nettests/experimental/tls_handshake.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/nettests/experimental/tls_handshake.py b/nettests/experimental/tls_handshake.py
index b715387..d2f58a3 100644
--- a/nettests/experimental/tls_handshake.py
+++ b/nettests/experimental/tls_handshake.py
@@ -226,6 +226,15 @@ class HandshakeTest(nettest.NetTestCase):
 
     @staticmethod
     def getPeerCert(connection, get_chain=False):
+        """Get the PEM-encoded certificate or cert chain of the remote host.
+
+        :param connection: A :class:`OpenSSL.SSL.Connection <Connection>`.
+        :param bool get_chain: If True, get the all certificates in the
+            chain. Otherwise, only get the remote host's certificate.
+        :returns: A PEM-encoded x509 certificate. If
+            :param:`getPeerCert.get_chain <get_chain>` is True, returns a list
+            of PEM-encoded x509 certificates.
+        """
         if not get_chain:
             x509_cert = connection.get_peer_certificate()
             pem_cert = crypto.dump_certificate(crypto.FILETYPE_PEM, x509_cert)





More information about the tor-commits mailing list