--- database/mysql/schema.sql	2013-01-08 13:58:13.000000000 +0100
+++ database/mysql/schema.sql	2013-01-08 14:02:56.000000000 +0100
@@ -141,6 +141,10 @@
 	`authentication`         integer         DEFAULT '0'               NOT NULL,
 	`http_user`              varchar(64)     DEFAULT ''                NOT NULL,
 	`http_password`          varchar(64)     DEFAULT ''                NOT NULL,
+	`cacertfile`		 varchar(255)    DEFAULT ''                NOT NULL,
+	`clientcertfile`	 varchar(255)    DEFAULT ''                NOT NULL,
+	`clientkeyfile`	 	 varchar(255)    DEFAULT ''                NOT NULL,
+	`clientkeypass`	 	 varchar(255)    DEFAULT ''                NOT NULL,
 	PRIMARY KEY (httptestid)
 ) ENGINE=InnoDB;
 CREATE INDEX `httptest_httptest_1` ON `httptest` (`applicationid`);

--- include/db.h	2012-12-08 12:09:14.000000000 +0100
+++ include/db.h	2013-01-07 14:42:28.000000000 +0100
@@ -402,6 +402,10 @@
 	char		*http_user;
 	char		*http_password;
 	int		authentication;
+	char		*cacertfile;
+	char		*clientcertfile;
+	char		*clientkeyfile;
+	char		*clientkeypass;
 }
 DB_HTTPTEST;

--- src/zabbix_server/httppoller/httptest.c	2012-12-08 12:09:15.000000000 +0100
+++ src/zabbix_server/httppoller/httptest.c	2013-01-08 13:41:22.000000000 +0100
@@ -278,6 +278,10 @@
 	int		err, opt;
 	char		auth[HTTPTEST_HTTP_USER_LEN_MAX + HTTPTEST_HTTP_PASSWORD_LEN_MAX];
 	CURL            *easyhandle = NULL;
+
+	static const char *pKeyType = "PEM" ;
+ 
+
 #endif
 
 	zabbix_log(LOG_LEVEL_DEBUG, "In %s() httptestid:" ZBX_FS_UI64 " name:'%s'",
@@ -314,6 +318,20 @@
 		goto clean;
 	}
 
+        if (            CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_SSLCERTTYPE,"PEM")) ||
+                        CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_SSLCERT,httptest->clientcertfile)) ||
+                        CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_SSLKEYPASSWD,httptest->clientkeypass)) ||
+                        CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_SSLKEYTYPE,pKeyType)) ||
+                        CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_SSLKEY,httptest->clientkeyfile)) ||
+                        CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_CAINFO,httptest->cacertfile)))
+        {
+                err_str = zbx_strdup(err_str, curl_easy_strerror(err));
+                zabbix_log(LOG_LEVEL_ERR, "web scenario \"%s\" error: could not set cURL SSL Client option [%d]: %s",
+                                httptest->name, opt, err_str);
+                goto clean;
+        }
+
+
 	while (NULL != (row = DBfetch(result)))
 	{
 		/* NOTE: do not break or return from this block! */
@@ -545,7 +563,7 @@
 	zabbix_log(LOG_LEVEL_DEBUG, "In %s()", __function_name);
 
 	result = DBselect(
-			"select t.httptestid,t.name,t.macros,t.agent,t.authentication,t.http_user,t.http_password"
+			"select t.httptestid,t.name,t.macros,t.agent,t.authentication,t.http_user,t.http_password,t.cacertfile,t.clientcertfile,t.clientkeyfile,t.clientkeypass"
 			" from httptest t,applications a,hosts h"
 			" where t.applicationid=a.applicationid"
 				" and a.hostid=h.hostid"
@@ -572,6 +590,10 @@
 		httptest.authentication = atoi(row[4]);
 		httptest.http_user = row[5];
 		httptest.http_password = row[6];
+		httptest.cacertfile = row[7];
+		httptest.clientcertfile = row[8];
+		httptest.clientkeyfile = row[9];
+		httptest.clientkeypass = row[10];
 
 		process_httptest(&httptest);
 	}

--- frontends/php/httpconf.php	2012-12-08 12:09:20.000000000 +0100
+++ httpconf.php	2013-01-08 10:50:34.000000000 +0100
@@ -45,6 +45,10 @@
 	'status' =>			array(T_ZBX_INT, O_OPT, null,	IN('0,1'),	'isset({save})'),
 	'agent' =>			array(T_ZBX_STR, O_OPT, null,	null,		'isset({save})'),
 	'macros' =>			array(T_ZBX_STR, O_OPT, null,	null,		'isset({save})'),
+	'cacertfile' =>			array(T_ZBX_STR, O_OPT, null,	null,		'isset({save})'),
+	'clientcertfile' =>		array(T_ZBX_STR, O_OPT, null,	null,		'isset({save})'),
+	'clientkeyfile' =>		array(T_ZBX_STR, O_OPT, null,	null,		'isset({save})'),
+	'clientkeypass' =>		array(T_ZBX_STR, O_OPT, null,	null,		'isset({save})'),
 	'steps' =>			array(T_ZBX_STR, O_OPT, null,	null,		'isset({save})', _('Steps')),
 	'authentication' =>	array(T_ZBX_INT, O_OPT, null,	IN('0,1,2'), 'isset({save})'),
 	'http_user' =>		array(T_ZBX_STR, O_OPT, null,	NOT_EMPTY,
@@ -235,6 +239,10 @@
 			'status' => $_REQUEST['status'],
 			'agent' => $_REQUEST['agent'],
 			'macros' => $_REQUEST['macros'],
+			'cacertfile' => $_REQUEST['cacertfile'],
+			'clientcertfile' => $_REQUEST['clientcertfile'],
+			'clientkeyfile' => $_REQUEST['clientkeyfile'],
+			'clientkeypass' => $_REQUEST['clientkeypass'],
 			'steps' => $steps
 		);
 
@@ -386,6 +394,10 @@
 		$data['status'] = $dbHttpTest['status'];
 		$data['agent'] = $dbHttpTest['agent'];
 		$data['macros'] = $dbHttpTest['macros'];
+		$data['cacertfile'] = $dbHttpTest['cacertfile'];
+		$data['clientcertfile'] = $dbHttpTest['clientcertfile'];
+		$data['clientkeyfile'] = $dbHttpTest['clientkeyfile'];
+		$data['clientkeypass'] = $dbHttpTest['clientkeypass'];
 		$data['authentication'] = $dbHttpTest['authentication'];
 		$data['http_user'] = $dbHttpTest['http_user'];
 		$data['http_password'] = $dbHttpTest['http_password'];
@@ -398,6 +410,10 @@
 		$data['status'] = get_request('status', HTTPTEST_STATUS_ACTIVE);
 		$data['agent'] = get_request('agent', '');
 		$data['macros'] = get_request('macros', array());
+		$data['cacertfile'] = get_request('cacertfile', '');
+		$data['clientcertfile'] = get_request('clientcertfile', '');
+		$data['clientkeyfile'] = get_request('clientkeyfile', '');
+		$data['clientkeypass'] = get_request('clientkeypass', '');
 		$data['authentication'] = get_request('authentication', HTTPTEST_AUTH_NONE);
 		$data['http_user'] = get_request('http_user', '');
 		$data['http_password'] = get_request('http_password', '');
--- frontends/php/include/schema.inc.php	2012-12-08 12:09:18.000000000 +0100
+++ include/schema.inc.php	2013-01-08 13:29:20.000000000 +0100
@@ -649,6 +649,30 @@
 				'type' => DB::FIELD_TYPE_TEXT,
 				'default' => '',
 			),
+			'cacertfile' => array(
+				'null' => false,
+				'type' => DB::FIELD_TYPE_CHAR,
+				'length' => 255,
+				'default' => '',
+			),
+			'clientcertfile' => array(
+				'null' => false,
+				'type' => DB::FIELD_TYPE_CHAR,
+				'length' => 255,
+				'default' => '',
+			),
+			'clientkeyfile' => array(
+				'null' => false,
+				'type' => DB::FIELD_TYPE_CHAR,
+				'length' => 255,
+				'default' => '',
+			),
+			'clientkeypass' => array(
+				'null' => false,
+				'type' => DB::FIELD_TYPE_CHAR,
+				'length' => 255,
+				'default' => '',
+			),
 			'agent' => array(
 				'null' => false,
 				'type' => DB::FIELD_TYPE_CHAR,
--- frontends/php/include/views/configuration.httpconf.edit.php	2012-12-08 12:09:17.000000000 +0100
+++ include/views/configuration.httpconf.edit.php	2013-01-08 10:23:49.000000000 +0100
@@ -115,6 +115,10 @@
 
 // append status to form list
 $httpFormList->addRow(_('Variables'), new CTextArea('macros', $this->data['macros']));
+$httpFormList->addRow(_('SSL CA Cert File'), new CTextBox('cacertfile', $this->data['cacertfile'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64));
+$httpFormList->addRow(_('SSL Client Cert File'), new CTextBox('clientcertfile', $this->data['clientcertfile'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64));
+$httpFormList->addRow(_('SSL Client Key File'), new CTextBox('clientkeyfile', $this->data['clientkeyfile'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64));
+$httpFormList->addRow(_('SSL Client Key Passphrase'), new CTextBox('clientkeypass', $this->data['clientkeypass'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64));
 $httpFormList->addRow(_('Active'), new CCheckBox('status', $this->data['status'] ? (!isset($_REQUEST['httptestid']) ? 1 : 0) : 1, null, 1)); // invert status 0 - enable, 1 - disable
 
 /*

