Index: /branches/rel_apv_10_7/usr/click/lib/libwebui/webui.c
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libwebui/webui.c	(revision 38912)
+++ /branches/rel_apv_10_7/usr/click/lib/libwebui/webui.c	(working copy)
@@ -1873,6 +1873,25 @@
 	return SUCCESS;
 }
 
+static int convert_pfx_to_pem(const char *pfx_file, const char *pem_file) 
+{
+    char command[1024];
+	char *pass;
+	pass = getpass("Enter the password of the pfx file: ");
+	if(pass == NULL){
+		printf("Error in reading password of the pfx file\n");
+		return FAIL;
+	}
+	// printf("Password entered: %s\n", pass);
+	snprintf(command, sizeof(command),
+	        "openssl pkcs12 -in \"%s\" -out \"%s\" -clcerts -passin pass:%s -passout pass:%s",
+        	pfx_file, pem_file, pass, pass);
+    if (system(command) != 0) {
+        return FAIL;
+    }
+    return SUCCESS;
+}
+
 static int
 import_file(char *url, char *outfile)
 {
@@ -1885,11 +1904,21 @@
 	{
 		char * file_dir = (char *)(url+6);
 		if (access(file_dir, F_OK) == 0) {
-			/* Bug 23370, chenyl, 20090810 */
-			snprintf(syscmd, MAX_SSL_CRT_COM_LEN, "mv -f \"%s\" \"%s\"", file_dir, outfile);
-			system(syscmd);
-			/* Bug 23370, end */
-			return SUCCESS;
+			if (strstr(file_dir, ".pfx")) {
+				if (convert_pfx_to_pem(file_dir, outfile) != SUCCESS) {
+					printf("Error: Failed to convert PFX to PEM\n");
+					return FAIL;
+				}
+				else {
+					return SUCCESS;
+				}
+			} else {
+				/* Bug 23370, chenyl, 20090810 */
+				snprintf(syscmd, MAX_SSL_CRT_COM_LEN, "mv -f \"%s\" \"%s\"", file_dir, outfile);
+				system(syscmd);
+				/* Bug 23370, end */
+				return SUCCESS;
+			}
 		}
 
 		printf("%s doesn't exist\n", file_dir);
