Using digital certificates for authentication instead of preshared keys in a VPN configuration is considered more secure. In SonicWall UTM devices, digital certificates are one way of authenticating two peer devices to establish an IPsec VPN tunnel. The other is IKE using preshared key. The KB article describes the method to configure WAN GroupVPN and Global VPN Clients (GVC) to use digital certificates for authentication before establishing an IPsec VPN tunnel.
Features of IKE Authentication with Certificates in SonicWall WAN GroupVPN and GVC.
The certificate signing process described here is using a Windows Server 2008 CA. To configure a Microsoft CA to accept a Subject Alternative Name attribute from a certificate request, refer this Microsoft article: How to configure a CA to accept a SAN attribute from a certificate request
Creating Certificate Signing Request (CSR) in the SonicWall
Login to the SonicWall management GUI

Click on Generate to save.

Refresh the page.
Click on the download button to download the CSR.

Obtaining certificates using Windows Server Certificate Enrollment Web Services
Obtaining a Gateway certificate to use in WAN GroupVPN configuration
Open a browser and navigate to the Microsoft Windows Certificate Enrollment page: http:///CertSrv
When prompted for authentication, enter username and password of Administrator.
Click on Request a certificate
Click on advanced certificate request.
Copy the contents of CSR in the Saved Request box.
Select Administrator under Certificate Template. Note: User or Web Server template also could be selected.
Under Attributes, either enter san:dns=yourdomainname.com or san:email=<local-part@domain.com>. Note: To configure a Microsoft CA to accept a Subject Alternative Name attribute from a certificate request, refer this Microsoft article: How to configure a CA to accept a SAN attribute from a certificate request
Click on Submit and you will taken to the next page.
On this page click on Download certificate or Download certificate chain to save the signed certificate to disk.






Below is an example of a signed certificate's Subject Alternative Name (SAN):
Downloading the CA certificate for the signed certificate.
Navigate to the Microsoft Windows Certificate Enrollment page: http:///CertSrv
Click on Download a CA certificate....
On the next page, click on Download CA certificate and save the certificate to disk.


Upload the signed certificate into the SonicWall via the upload button of the CSR pending request.


To establish trust and complete the validation of the signed certificate, import the CA certificate



Obtaining a user certificate for GVC clients.
Navigate to the Microsoft Windows Certificate Enrollment page: http:///CertSrv
When prompted for authentication, enter username and password of a Domain User.
Click on Request a certificate
Click on advanced certificate request.
Select User under Certificate Template. Note: Administrator or Web Server template also could be selected.
Under Attributes, either enter san:dns=yourdomainname.com or san:email=<local-part@domain.com>. Note: To configure a Microsoft CA to accept a Subject Alternative Name attribute from a certificate request, refer this Microsoft article: How to configure a CA to accept a SAN attribute from a certificate request
Click on Submit and you will taken to the next page.
On this page click on Download certificate or Download certificate chain to save the signed certificate to disk.




The signed certificate will be installed within the browser.

Export the certificate with its private key from the browser.





Configuring WAN GroupVPN
Login to the SonicWall management GUI
Navigate to the VPN | Base Settings page.
Enable the Enable VPN check box at the top and the Enable check box of WAN GroupVPN.
Click on Accept at the top to save the changes.
Click on the configure button under WAN GroupVPN to open the VPN Policy window.
Select Authentication Method as IKE using 3rd Party Certificates.
Select the signed certificate, imported into the SonicWall earlier, under Gateway Certificate


Peer Certificates
When setting Peer ID Type, the administrator may choose from Distinguished Name, Email Address or Domain Name. The IDs must be of the certificate to be used in the remote client (GVC). This is the certificate obtained from the Windows CA, installed in the browser and exported with private key earlier.
Peer ID Type: Domain Name - In this example, this is the attribute set at the time of obtaining the user certificate and found under the Subject Alternative Name field of the certificate - hal-2010.local
Peer ID Type: Email ID - This must be attribute of san:email=<email@address.com| set at the time of obtaining the user certificate and found under the Subject Alternative Name field of the certificate. For example, the string *@hal-2010.local would allow anyone with an email address ending in hal-2010.local to have access;
Peer ID Type: Distinguished Name - DN is a specific reference to a particulare certificate. To use DN for multiple users with certificates from the same domain, you must use a field common to all the user certificates. For example, for a Subject DN such as this:
/C=IN/ST=KA/O=SonicWall Inc./CN=gvc.kb-soniclab.local/emailAddress=admin@kb-soniclab.local.
Any of the following could be used:
O=SonicWall Inc. or
CN=gvc.kb-soniclab.local
The exact DN can be found using the following OpenSSL command:

Importing the user certificate into the GVC client and establishing a connection
Open the GVC client
Click on View | Certificate to open the Certificate window.
Click on Import to import the user certificate.
After the user certificate is imported, the CA certificate must be imported to establish trust. Until trust is established the Certificate window may show a message, The certificate chain is not complete.
Once trust is established, the GVC client is ready to connect to the SonicWall. Create a connection and enable it.







