From 86b9a3854c8cd0921f27b7e6d989359210b6c357 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Fri, 30 Nov 2012 10:04:42 +0100
Subject: [PATCH] Fix breakage introduced in commit a8b3b09
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The order of the calls to β€œctx.use_privatekey” and β€œctx.use_certificate”
was wrong, leading to an exception being thrown.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
---
 lib/utils/x509.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/utils/x509.py b/lib/utils/x509.py
index fc01ce3fb..c1fa52e17 100644
--- a/lib/utils/x509.py
+++ b/lib/utils/x509.py
@@ -334,7 +334,7 @@ def PrepareX509CertKeyCheck(cert, key):
 
   """
   ctx = OpenSSL.SSL.Context(OpenSSL.SSL.TLSv1_METHOD)
-  ctx.use_certificate(cert)
   ctx.use_privatekey(key)
+  ctx.use_certificate(cert)
 
   return ctx.check_privatekey
-- 
GitLab