diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 699d601..8a59211 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -223,6 +223,7 @@ get_password_types (PasswordsInfo *info)
 	char *connection_path = NULL;
 	gboolean success = FALSE;
 	char *connection_type;
+	char *p, *ext;
 
 	/* FIXME: This whole thing sucks: we should not go around poking gconf
 	   directly, but there's nothing that does it for us right now */
@@ -289,8 +290,18 @@ get_password_types (PasswordsInfo *info)
 		key = g_strdup_printf ("%s/%s/%s", connection_path, NM_SETTING_VPN_SETTING_NAME,
 		                       NM_OPENVPN_KEY_KEY);
 		str = gconf_client_get_string (gconf_client, key, NULL);
-		if (str)
-			info->need_certpass = pem_is_encrypted (str);
+		
+	        p = strrchr (str, '.');
+	        if (p)
+		        ext = g_ascii_strdown (p, -1);
+		if (strcmp(ext, ".p12")) {
+
+			if (str)
+				info->need_certpass = pem_is_encrypted (str);
+		}
+		else
+			info->need_certpass = TRUE;
+
 		g_free (str);
 		g_free (key);
 	} else if (!strcmp (connection_type, NM_OPENVPN_CONTYPE_STATIC_KEY)) {
diff --git a/properties/auth-helpers.c b/properties/auth-helpers.c
index 9120385..95d93bf 100644
--- a/properties/auth-helpers.c
+++ b/properties/auth-helpers.c
@@ -35,6 +35,7 @@
 #include <glib/gi18n-lib.h>
 #include <gnome-keyring-memory.h>
 #include <nm-setting-connection.h>
+#include <nm-setting-8021x.h>
 
 #include "auth-helpers.h"
 #include "nm-openvpn.h"
@@ -129,6 +130,67 @@ fill_vpn_passwords (GladeXML *xml,
 	}
 }
 
+
+static gboolean
+has_extension_p12(const char *filename)
+{
+        char  *p, *ext;
+
+        p = strrchr (filename, '.');
+        if (!p)
+                return FALSE;
+
+        ext = g_ascii_strdown (p, -1);
+        if (!ext)
+                return FALSE;
+
+        if (!strcmp(ext,".p12")) {
+                g_free (ext);
+                return TRUE;
+        }
+	else
+		return FALSE;
+
+	return TRUE;		
+}
+
+static void
+tls_cert_changed_cb(GtkWidget *widget, GtkWidget *next)
+{
+	gchar *filename,*tmp;
+
+	filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget));
+
+	if (filename && strlen(filename)) {
+		if (has_extension_p12(filename)) {
+			tmp = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(next));
+	
+			if (tmp && strlen(tmp)) {
+				if (!strcmp(filename,tmp))
+					return;
+				else
+					gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(next),(const char *)filename);
+			} else
+					gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(next),(const char *)filename);
+		}	
+		else {
+			tmp = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(next));
+			if (tmp && strlen(tmp)) {
+				if(has_extension_p12(tmp)) 
+					gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(next),NULL);
+			}
+		}
+	} 
+	else {
+		tmp = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(next));
+                if (tmp && strlen(tmp)) {
+                	if(has_extension_p12(tmp)) 
+	                       	gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(next),NULL);
+                                
+                        }
+	}
+}
+
 void
 tls_pw_init_auth_widget (GladeXML *xml,
                          GtkSizeGroup *group,
@@ -138,7 +200,7 @@ tls_pw_init_auth_widget (GladeXML *xml,
                          ChangedCallback changed_cb,
                          gpointer user_data)
 {
-	GtkWidget *widget;
+	GtkWidget *widget,*ca,*cert,*key;
 	const char *value;
 	char *tmp;
 	GtkFileFilter *filter;
@@ -147,13 +209,20 @@ tls_pw_init_auth_widget (GladeXML *xml,
 	g_return_if_fail (group != NULL);
 	g_return_if_fail (changed_cb != NULL);
 	g_return_if_fail (prefix != NULL);
-
+	
 	tmp = g_strdup_printf ("%s_ca_cert_chooser", prefix);
 	widget = glade_xml_get_widget (xml, tmp);
+	ca = widget;
+
+	
 	g_free (tmp);
 
 	gtk_size_group_add_widget (group, widget);
-	filter = tls_file_chooser_filter_new ();
+        if (!strcmp (contype, NM_OPENVPN_CONTYPE_TLS) || !strcmp (contype, NM_OPENVPN_CONTYPE_PASSWORD_TLS))
+		filter = tls_file_chooser_filter_new (TRUE);
+	else
+		filter = tls_file_chooser_filter_new (FALSE);
+
 	gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (widget), filter);
 	gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (widget), TRUE);
 	gtk_file_chooser_button_set_title (GTK_FILE_CHOOSER_BUTTON (widget),
@@ -169,16 +238,18 @@ tls_pw_init_auth_widget (GladeXML *xml,
 	if (!strcmp (contype, NM_OPENVPN_CONTYPE_TLS) || !strcmp (contype, NM_OPENVPN_CONTYPE_PASSWORD_TLS)) {
 		tmp = g_strdup_printf ("%s_user_cert_chooser", prefix);
 		widget = glade_xml_get_widget (xml, tmp);
+		cert = widget;
 		g_free (tmp);
 
 		gtk_size_group_add_widget (group, widget);
-		filter = tls_file_chooser_filter_new ();
+		filter = tls_file_chooser_filter_new (TRUE);
 		gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (widget), filter);
 		gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (widget), TRUE);
 		gtk_file_chooser_button_set_title (GTK_FILE_CHOOSER_BUTTON (widget),
 		                                   _("Choose your personal certificate..."));
 		g_signal_connect (G_OBJECT (widget), "selection-changed", G_CALLBACK (changed_cb), user_data);
 
+
 		if (s_vpn) {
 			value = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CERT);
 			if (value && strlen (value))
@@ -187,10 +258,11 @@ tls_pw_init_auth_widget (GladeXML *xml,
 
 		tmp = g_strdup_printf ("%s_private_key_chooser", prefix);
 		widget = glade_xml_get_widget (xml, tmp);
+		key = widget;
 		g_free (tmp);
-
+	
 		gtk_size_group_add_widget (group, widget);
-		filter = tls_file_chooser_filter_new ();
+		filter = tls_file_chooser_filter_new (TRUE);
 		gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (widget), filter);
 		gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (widget), TRUE);
 		gtk_file_chooser_button_set_title (GTK_FILE_CHOOSER_BUTTON (widget),
@@ -202,6 +274,12 @@ tls_pw_init_auth_widget (GladeXML *xml,
 			if (value && strlen (value))
 				gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), value);
 		}
+
+		/* Link to the changer callback now*/
+		g_signal_connect (G_OBJECT(ca),"selection-changed", G_CALLBACK (tls_cert_changed_cb), (gpointer) cert);
+                g_signal_connect (G_OBJECT(cert),"selection-changed", G_CALLBACK (tls_cert_changed_cb), (gpointer) key);
+                g_signal_connect (G_OBJECT(key),"selection-changed", G_CALLBACK (tls_cert_changed_cb), (gpointer) ca);
+
 	}
 
 	if (!strcmp (contype, NM_OPENVPN_CONTYPE_PASSWORD) || !strcmp (contype, NM_OPENVPN_CONTYPE_PASSWORD_TLS)) {
@@ -313,6 +391,28 @@ sk_init_auth_widget (GladeXML *xml,
 }
 
 static gboolean
+validate_pkcs12 (const char *filename)
+{
+        NMSetting8021xCKFormat format = NM_SETTING_802_1X_CK_FORMAT_UNKNOWN;
+        gboolean success;
+        NMSetting8021x *s_8021x = NM_SETTING_802_1X (nm_setting_802_1x_new ());
+
+	if (!g_file_test (filename, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))
+		return FALSE;
+
+        success = nm_setting_802_1x_set_private_key (s_8021x, filename, NULL, NM_SETTING_802_1X_CK_SCHEME_PATH, &format, NULL);
+
+        if (format == NM_SETTING_802_1X_CK_FORMAT_PKCS12) {
+                g_object_unref (s_8021x);
+                return TRUE;
+        }
+
+        g_object_unref (s_8021x);
+        return FALSE;
+}
+
+
+static gboolean
 validate_file_chooser (GladeXML *xml, const char *name)
 {
 	GtkWidget *widget;
@@ -322,6 +422,10 @@ validate_file_chooser (GladeXML *xml, const char *name)
 	str = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
 	if (!str || !strlen (str))
 		return FALSE;
+
+	if (has_extension_p12(str)) 
+		return(validate_pkcs12(str));
+	
 	return TRUE;
 }
 
@@ -629,9 +733,11 @@ tls_default_filter (const GtkFileFilterInfo *filter_info, gpointer data)
 {
 	char *contents = NULL, *p, *ext;
 	gsize bytes_read = 0;
-	gboolean show = FALSE;
+	gboolean show = FALSE,NeedPKCS;
 	struct stat statbuf;
 
+	NeedPKCS = GPOINTER_TO_INT (data);
+
 	if (!filter_info->filename)
 		return FALSE;
 
@@ -642,6 +748,12 @@ tls_default_filter (const GtkFileFilterInfo *filter_info, gpointer data)
 	ext = g_ascii_strdown (p, -1);
 	if (!ext)
 		return FALSE;
+
+	if (NeedPKCS && (!strcmp(ext,".p12"))) {
+		g_free (ext);
+		return TRUE;
+	}
+	
 	if (strcmp (ext, ".pem") && strcmp (ext, ".crt") && strcmp (ext, ".key") && strcmp (ext, ".cer")) {
 		g_free (ext);
 		return FALSE;
@@ -682,13 +794,20 @@ out:
 }
 
 GtkFileFilter *
-tls_file_chooser_filter_new (void)
+tls_file_chooser_filter_new (gboolean NeedPKCS)
 {
 	GtkFileFilter *filter;
 
 	filter = gtk_file_filter_new ();
-	gtk_file_filter_add_custom (filter, GTK_FILE_FILTER_FILENAME, tls_default_filter, NULL, NULL);
-	gtk_file_filter_set_name (filter, _("PEM certificates (*.pem, *.crt, *.key, *.cer)"));
+	if (NeedPKCS) {
+	        gtk_file_filter_add_custom (filter, GTK_FILE_FILTER_FILENAME, tls_default_filter, GINT_TO_POINTER(TRUE), NULL);
+		gtk_file_filter_set_name (filter, _("PEM or PKCS#12 certificates (*.pem, *.crt, *.key, *.cer, *.p12)"));
+	}
+	else {
+		gtk_file_filter_add_custom (filter, GTK_FILE_FILTER_FILENAME, tls_default_filter, GINT_TO_POINTER(FALSE), NULL);
+		gtk_file_filter_set_name (filter, _("PEM certificates (*.pem, *.crt, *.key, *.cer)"));
+	}
+
 	return filter;
 }
 
diff --git a/properties/auth-helpers.h b/properties/auth-helpers.h
index b5ea395..ceacf34 100644
--- a/properties/auth-helpers.h
+++ b/properties/auth-helpers.h
@@ -63,7 +63,7 @@ gboolean auth_widget_save_secrets (GladeXML *xml,
 								   const char *uuid,
 								   const char *name);
 
-GtkFileFilter *tls_file_chooser_filter_new (void);
+GtkFileFilter *tls_file_chooser_filter_new (gboolean NeedPKCS);
 
 GtkFileFilter *sk_file_chooser_filter_new (void);
 
diff --git a/properties/import-export.c b/properties/import-export.c
index d5df3ec..4a10c6a 100644
--- a/properties/import-export.c
+++ b/properties/import-export.c
@@ -62,6 +62,7 @@
 #define TLS_REMOTE_TAG "tls-remote"
 #define PORT_TAG "port"
 #define RPORT_TAG "rport"
+#define PKCS12_TAG "pkcs12"
 
 
 static char *
@@ -338,6 +339,12 @@ do_import (const char *path, char **lines, GError **error)
 			}
 		}
 
+		if ( handle_path_item (*line, PKCS12_TAG, NM_OPENVPN_KEY_CA, s_vpn, default_path, NULL) &&
+		     handle_path_item (*line, PKCS12_TAG, NM_OPENVPN_KEY_CERT, s_vpn, default_path, NULL) &&
+		     handle_path_item (*line, PKCS12_TAG, NM_OPENVPN_KEY_KEY, s_vpn, default_path, NULL))
+			continue;
+
+
 		if (handle_path_item (*line, CA_TAG, NM_OPENVPN_KEY_CA, s_vpn, default_path, NULL))
 			continue;
 
@@ -612,12 +619,16 @@ do_export (const char *path, NMConnection *connection, GError **error)
 	         port ? " " : "",
 	         port ? port : "");
 
-	if (cacert)
-		fprintf (f, "ca %s\n", cacert);
-	if (user_cert)
-		fprintf (f, "cert %s\n", user_cert);
-	if (private_key)
-		fprintf(f, "key %s\n", private_key);
+	if ((!strcmp(cacert,user_cert)) && (!strcmp(user_cert,private_key))) 
+		fprintf (f, "pkcs12 %s\n", cacert);
+	else {
+		if (cacert)
+			fprintf (f, "ca %s\n", cacert);
+		if (user_cert)
+			fprintf (f, "cert %s\n", user_cert);
+		if (private_key)
+			fprintf(f, "key %s\n", private_key);
+	}
 
 	if (   !strcmp(connection_type, NM_OPENVPN_CONTYPE_PASSWORD)
 	    || !strcmp(connection_type, NM_OPENVPN_CONTYPE_PASSWORD_TLS))
diff --git a/src/nm-openvpn-service.c b/src/nm-openvpn-service.c
index 7405322..8627f0d 100644
--- a/src/nm-openvpn-service.c
+++ b/src/nm-openvpn-service.c
@@ -638,6 +638,7 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin,
 	GPtrArray *args;
 	GSource *openvpn_watch;
 	GPid pid;
+	const char *ca, *cert, *key;
 
 	/* Find openvpn */
 	openvpn_binary = nm_find_openvpn ();
@@ -809,22 +810,30 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin,
 	if (!strcmp (connection_type, NM_OPENVPN_CONTYPE_TLS)) {
 		add_openvpn_arg (args, "--client");
 
-		tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CA);
-		if (tmp && strlen (tmp)) {
-			add_openvpn_arg (args, "--ca");
-			add_openvpn_arg (args, tmp);
-		}
 
-		tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CERT);
-		if (tmp && strlen (tmp)) {
-			add_openvpn_arg (args, "--cert");
-			add_openvpn_arg (args, tmp);
+		ca = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CA);
+		cert = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CERT);
+		key = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_KEY);
+
+		if ((!strcmp(ca,cert)) && (!strcmp(cert,key))) {
+			add_openvpn_arg (args, "--pkcs12");
+			add_openvpn_arg (args, ca);
 		}
+		else {
+			if (ca && strlen (ca)) {
+				add_openvpn_arg (args, "--ca");
+				add_openvpn_arg (args, ca);
+			}
 
-		tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_KEY);
-		if (tmp && strlen (tmp)) {
-			add_openvpn_arg (args, "--key");
-			add_openvpn_arg (args, tmp);
+			if (cert && strlen (cert)) {
+				add_openvpn_arg (args, "--cert");
+				add_openvpn_arg (args, cert);
+			}
+	
+			if (key && strlen (key)) {
+				add_openvpn_arg (args, "--key");
+				add_openvpn_arg (args, key);
+			}
 		}
 	} else if (!strcmp (connection_type, NM_OPENVPN_CONTYPE_STATIC_KEY)) {
 		tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_STATIC_KEY);
@@ -878,23 +887,31 @@ nm_openvpn_start_openvpn_binary (NMOpenvpnPlugin *plugin,
 	} else if (!strcmp (connection_type, NM_OPENVPN_CONTYPE_PASSWORD_TLS)) {
 		add_openvpn_arg (args, "--client");
 
-		tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CA);
-		if (tmp && strlen (tmp)) {
-			add_openvpn_arg (args, "--ca");
-			add_openvpn_arg (args, tmp);
-		}
+                ca = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CA);
+                cert = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CERT);
+                key = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_KEY);
+
+                if ((!strcmp(ca,cert)) && (!strcmp(cert,key))) {
+                        add_openvpn_arg (args, "--pkcs12");
+                        add_openvpn_arg (args, ca);
+                }
+                else {
+                        if (ca && strlen (ca)) {
+                                add_openvpn_arg (args, "--ca");
+                                add_openvpn_arg (args, ca);
+                        }
+
+                        if (cert && strlen (cert)) {
+                                add_openvpn_arg (args, "--cert");
+                                add_openvpn_arg (args, cert);
+                        }
+
+                        if (key && strlen (key)) {
+                                add_openvpn_arg (args, "--key");
+                                add_openvpn_arg (args, key);
+                        }
+                }
 
-		tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_CERT);
-		if (tmp && strlen (tmp)) {
-			add_openvpn_arg (args, "--cert");
-			add_openvpn_arg (args, tmp);
-		}
-
-		tmp = nm_setting_vpn_get_data_item (s_vpn, NM_OPENVPN_KEY_KEY);
-		if (tmp && strlen (tmp)) {
-			add_openvpn_arg (args, "--key");
-			add_openvpn_arg (args, tmp);
-		}
 
 		/* Use user/path authentication */
 		add_openvpn_arg (args, "--auth-user-pass");
