fixes unicode quotes and adds load_cert_chain test.

This commit is contained in:
Moisés Guimarães 2016-11-15 14:53:42 -03:00
parent 760ddd14f5
commit 015ffecbab
2 changed files with 10 additions and 6 deletions

View File

@ -34,9 +34,13 @@ class TestSSLContext(unittest.TestCase):
def test_context_creation(self):
self.assertIsNotNone(self.ctx)
def test_load_cert_chain(self):
def test_load_cert_chain_raises(self):
self.assertRaises(TypeError, self.ctx.load_cert_chain, None)
def test_load_cert_chain(self):
self.ctx.load_cert_chain("../../../certs/client-cert.pem",
"../../../certs/client-key.pem")
def test_load_verify_locations_raises(self):
self.assertRaises(TypeError, self.ctx.load_verify_locations, None)

View File

@ -18,8 +18,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
try:
from wolfssl._ffi import ffi as _ffi
from wolfssl._ffi import lib as _lib
from wolfssl._ffi import ffi as _ffi
from wolfssl._ffi import lib as _lib
except ImportError:
pass
@ -77,7 +77,7 @@ class SSLContext:
Load a private key and the corresponding certificate. The certfile
string must be the path to a single file in PEM format containing
the certificate as well as any number of CA certificates needed to
establish the certificates authenticity.
establish the certificate's authenticity.
The keyfile string, if present, must point to a file containing the
private key in.
@ -100,8 +100,8 @@ class SSLContext:
def load_verify_locations(self, cafile=None, capath=None, cadata=None):
"""
Load a set of certification authority (CA) certificates used to
validate other peers certificates when verify_mode is other than
Load a set of "certification authority" (CA) certificates used to
validate other peers' certificates when verify_mode is other than
CERT_NONE. At least one of cafile or capath must be specified.
The cafile string, if present, is the path to a file of concatenated