Fix set_cipher_list on modern OpenSSL

Also port forward a few changes from #422.
diff --git a/src/OpenSSL/_util.py b/src/OpenSSL/_util.py
index 074ef3d..cba72ad 100644
--- a/src/OpenSSL/_util.py
+++ b/src/OpenSSL/_util.py
@@ -1,9 +1,11 @@
-from warnings import warn
 import sys
+import warnings
 
 from six import PY3, binary_type, text_type
 
 from cryptography.hazmat.bindings.openssl.binding import Binding
+
+
 binding = Binding()
 binding.init_static_locks()
 ffi = binding.ffi
@@ -47,6 +49,21 @@
     raise exception_type(errors)
 
 
+def make_assert(error):
+    """
+    Create an assert function that uses :func:`exception_from_error_queue` to
+    raise an exception wrapped by *error*.
+    """
+    def openssl_assert(ok):
+        """
+        If ok is not true-ish, retrieve the error from OpenSSL and raise it.
+        """
+        if not ok:
+            exception_from_error_queue(error)
+
+    return openssl_assert
+
+
 def native(s):
     """
     Convert :py:class:`bytes` or :py:class:`unicode` to the native
@@ -116,7 +133,7 @@
         returned.
     """
     if isinstance(obj, text_type):
-        warn(
+        warnings.warn(
             _TEXT_WARNING.format(label),
             category=DeprecationWarning,
             stacklevel=3