* test/certs/create_certs.py (create_crl): Support versions of PyOpenSSL that
   require that the digest parameter is set explicitly in crl.export().

Suggested by: jamessan


git-svn-id: https://svn.apache.org/repos/asf/serf/trunk@1845542 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/certs/create_certs.py b/test/certs/create_certs.py
index 5f93fb5..b738bab 100755
--- a/test/certs/create_certs.py
+++ b/test/certs/create_certs.py
@@ -78,7 +78,13 @@
     revoked.set_rev_date(now_str)   # revoked as of now
 
     crl.add_revoked(revoked)
-    open(crlfile, "wt").write(crl.export(cacert, cakey, days=next_crl_days))
+    try:
+        exported = crl.export(cacert, cakey, days=next_crl_days, digest=b"md5")
+    except TypeError:
+        # Some very old versions of pyopenssl (such as the one on macOS)
+        # do not support the 'digest' keyword argument.
+        exported = crl.export(cacert, cakey, days=next_crl_days)
+    open(crlfile, "wt").write(exported)
 
 # subjectAltName
 def create_cert(subjectkey, certfile, issuer=None, issuerkey=None, country='',