--- vpn.inc	2008-05-12 15:05:53.000000000 -0400
+++ new/vpn.inc	2008-05-12 15:05:41.000000000 -0400
@@ -210,7 +210,11 @@
 				} else if (isset($tunnel['p1']['myident']['asn1dn'])) {
 					$myidentt = "asn1dn";
 					$myident = $tunnel['p1']['myident']['asn1dn'];
- 				}
+				}
+
+				if (!($myidentt == "asn1dn" && $myident == "")) {
+					$myident = " \"".$myident."\"";
+				}
 
 				$nattline = '';
 				if (isset($tunnel['natt'])) {
@@ -281,7 +285,7 @@
 				$racoonconf .= <<<EOD
 remote {$rgip} \{
 	exchange_mode {$tunnel['p1']['mode']};
-	my_identifier {$myidentt} "{$myident}";
+	my_identifier {$myidentt}{$myident};
 	{$nattline}
 	{$certline}
 	peers_identifier address {$rgip};
@@ -347,7 +351,11 @@
 				} else if (isset($tunnel['p1']['myident']['asn1dn'])) {
 					$myidentt = "asn1dn";
 					$myident = $tunnel['p1']['myident']['asn1dn'];
- 				}
+				}
+
+				if (!($myidentt == "asn1dn" && $myident == "")) {
+					$myident = " \"".$myident."\"";
+				}
 
 				$nattline = '';
 				if (isset($tunnel['natt'])) {
@@ -402,7 +410,7 @@
 				$racoonconf .= <<<EOD
 remote anonymous \{
 	exchange_mode {$tunnel['p1']['mode']};
-	my_identifier {$myidentt} "{$myident}";
+	my_identifier {$myidentt}{$myident};
 	{$nattline}
 	{$certline}
 	initial_contact on;
