Windows Server Routing and Remote Access Service (RRAS) is popular for Always On VPN deployments because it supports the Secure Socket Tunneling Protocol (SSTP). The SSTP VPN protocol is recommended for use with the Always On VPN user tunnel because it is firewall friendly. Installing a TLS certificate on the VPN server is necessary to support SSTP VPN connections. Administrators should use a TLS certificate signed by a public certification authority (CA) for optimal reliability and performance.
Click here to view a video demonstration of the procedures outlined in this article.
Certificate Expiration
Of course, all certificates expire, and the TLS certificate used for SSTP is no exception. When using a public TLS certificate, the certificate lifetime is typically no more than one year, which means Always On VPN administrators will be renewing this certificate regularly.
Certificate Renewal
The process of “renewing” an SSTP TLS certificate is essentially the same as installing a new one, as it is best to create a new public/private key pair when renewing a certificate. The following outlines the steps required to generate a Certificate Signing Request (CSR), import the certificate, then assign the certificate to the SSTP listener on the VPN server.
Note: The guidance provided here assumes using an ECC certificate, which is best for optimal security and performance. More details here.
Certificate Request
Open the local computer certificate store (certlm.msc) on the VPN server and perform the following steps to generate a new CSR.
- Expand Certificates – Local Computer > Personal.
- Right-click the Certificates folder and choose All Tasks > Advanced Operations > Create Custom Request.
- Click Next.
- Highlight Proceed without enrollment policy.
- Click Next.
- Select (No template) CNG key from the Template drop-down list.
- Select PKCS #10 in the Request format section.
- Click Next.
- Click on the down arrow next to Details.
- Click on the Properties button.
- Select the General tab.
- Enter the public hostname for the certificate in the Friendly name field.
- Select the Subject tab.
- Select Common name from the Type drop-down list in the Subject name section.
- Enter the public hostname for the certificate in the Value field.
- Click Add.
- In the Alternative name section, select DNS from the Type drop-down list.
- Enter the public hostname for the certificate in the Value field.
- Click Add.
- Select the Extensions tab.
- Expand the Extended Key Usage section.
- Select Server Authentication from the Available options section.
- Click Add.
- Select the Private Key tab.
- Expand the Cryptographic Service Provider section.
- Uncheck the box next to RSA,Microsoft Software Key Storage Provider.
- Check the box next to ECDSA_P256,Microsoft Software Key Storage Provider.
- Expand the Key options section.
- Check the box next to Make private key exportable.
- Check the box next to Make private key exportable.
- Expand the Cryptographic Service Provider section.
- Click Ok.
- Click Next.
- Enter a name for the file in the File Name field.
- Select Base 64 in the File format section.
- Click Finish.
Import Certificate
Once complete, submit the file created to a public CA for signing. When the CA returns the signed certificate, perform the following steps to import it to the local compute certificate store.
- Right-click the Certificates folder and choose All Tasks > Import.
- Click Next.
- Enter the name of the certificate file returned by the public CA in the File name field.
- Click Next.
- Select Place all certificates in the following store and ensure that Personal is listed in the Certificate store field.
- Click Next.
- Click Finish.
- Click Ok.
Assign Certificate
After importing the new TLS certificate in the local computer’s certificate store, open the Routing and Remote Access management console (rrasmgmt.msc) and perform the following steps to assign the TLS certificate to the SSTP listener.
- Right-click the VPN server and choose Properties.
- Select the Security tab.
- Select the new TLS certificate from the Certificate drop-down list in the SSL Certificate Binding section. When replacing an existing certificate, you may see a certificate with the same name more than once. Click the View button and ensure the new certificate is selected.
- Click Ok.
- Click Yes to restart the RemoteAccess service.
Demonstration Video
A recorded video demonstration of this process can be found here. The video recording also includes guidance for making these changes on Windows Server Core servers.
Additional Information
Installing or Renewing an SSL/TLS Certificate on Windows Server for Always On VPN and SSTP.
Microsoft Windows Always On VPN SSTP Security Configuration
Microsoft Windows Always On VPN SSL Certificate Requirements for SSTP
Microsoft Windows Always On VPN ECDSA TLS Certificate Request for SSTP
Microsoft Windows Always On VPN SSTP with Let’s Encrypt Certificates
Michael Leeming
/ February 10, 2022Nice artikel, it is also possible to use the internal trusted CA to issue this certificate, as only domain joined machines needs to trust the certificate.
Richard M. Hicks
/ February 10, 2022Technically speaking, yes. Practically, it isn’t recommended. To use a TLS certificate for SSTP issued by your internal private PKI you must make your internal CRL available publicly. Most internal PKIs aren’t configured this way. If the internal CRL isn’t reachable from the Internet, Always On VPN clients won’t be able to validate the certificate and connections will fail. Always best to use a public CA certificate. You can even use Let’s Encrypt certificates, which are free. 🙂
https://directaccess.richardhicks.com/2021/10/04/always-on-vpn-sstp-with-lets-encrypt-certificates/
John Tinson
/ February 22, 2022Hi Richard, yet another great article as always. I am looking at renewing the existing internal RSA certificate on our RRAS gateway servers with an ECDSA_256 public certificate. The existing RSA certificate supports both our user tunnel SSTP users and any IKEv2 device tunnels as and when they are required.
To confirm my understanding is correct, i won’t be able to use a public ECDSA_256 certificate with IKEv2 so will need to start maintaining two certificates going forward.
For SSTP: A public ECDSA_256 certificate with Server Authentication EKU issued to our external VPN gateway address
For IKEv2: An internally issued RSA 2048 certificate with Server Authentication and IP security IKE intermediate EKU issued to our external VPN gateway address.
Both certificates will reside in the personal Computer store on each RRAS gateway server.
Thanks very much in advance
Richard M. Hicks
/ February 22, 2022You can use a public EC TLS certificate for IKEv2, but you shouldn’t. 🙂 You should always use an internal private certificate for IKEv2 to ensure only devices from your organization can connect using the device tunnel. With that, yes, you’ll need to maintain two certificates, one EC for SSTP (public CA) and one RSA for IKEv2 (private CA).
John Tinson
/ March 24, 2022Excellent, thank you Richard for the confirmation.
Adam
/ April 6, 2023Great post as always, thanks Richard!