From 87d61f8a6efdf1f9b0a0d6e8c59e323e6004ec72 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Wed, 24 Jun 2015 19:31:26 -0500 Subject: Use utf8 to encode attribute values instead of ascii --- src/cryptography/hazmat/backends/openssl/backend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index 7963b5d3..78de79d1 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -90,12 +90,12 @@ def _encode_name(backend, attributes): subject = backend._lib.X509_NAME_new() subject = backend._ffi.gc(subject, backend._lib.X509_NAME_free) for attribute in attributes: - value = attribute.value.encode('ascii') + value = attribute.value.encode('utf8') obj = _txt2obj(backend, attribute.oid.dotted_string) res = backend._lib.X509_NAME_add_entry_by_OBJ( subject, obj, - backend._lib.MBSTRING_ASC, + backend._lib.MBSTRING_UTF8, value, -1, -1, 0, ) -- cgit v1.2.3