From f5348055cd7a55084c4b0788a79fc4385324b6f1 Mon Sep 17 00:00:00 2001
From: Nigel Kukard <nkukard@lbsd.net>
Date: Fri, 26 Jul 2013 12:42:54 +0000
Subject: [PATCH] Make sure that $context doesn't end up undefined

Change-Id: Ieb53bb4f0e15fc82ff6051f5563e1aadabb496ac
---
 modules/registrars/cozaepp/cozaepp.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/registrars/cozaepp/cozaepp.php b/modules/registrars/cozaepp/cozaepp.php
index 534e17d..c03cc5d 100644
--- a/modules/registrars/cozaepp/cozaepp.php
+++ b/modules/registrars/cozaepp/cozaepp.php
@@ -1139,6 +1139,8 @@ function _cozaepp_Client() {
 		throw new Exception('System configuration error(2), please contact your provider');
 	}
 
+	# Create SSL context
+	$context = stream_context_create();
 	# Are we using ssl?
 	$use_ssl = false;
 	if (!empty($params['SSL']) && $params['SSL'] == 'on') {
@@ -1149,9 +1151,7 @@ function _cozaepp_Client() {
 		if (!file_exists($params['Certificate'])) {
 			throw new Exception("System configuration error(3), please contact your provider");
 		}
-
-		# Create SSL context
-		$context = stream_context_create();
+		# Set client side certificate
 		stream_context_set_option($context, 'ssl', 'local_cert', $params['Certificate']);
 	}
 
-- 
GitLab