Connect and Authorize Hardware Tokens
OpenVPN Connect supports external certificates on PKCS#11 hardware tokens for VPN connections.
OpenVPN Connect supports external certificates on PKCS#11 hardware tokens for VPN connections. This page provides an overview of setting it up on your device. The instructions are applicable for Yubikey hardware tokens with PKCS#11 support, such as Yubikey 5 NFC. You can try the same steps with modules for hardware tokens of other vendors.
Tip
Support for PKCS#11 hardware tokens requires Windows or macOS and OpenVPN Connect 3.3 and newer.
OpenVPN Connect v3 supports RSA-based certificates. OpenVPN Connect 3.5 supports loading ECC certificates when using hardware tokens such as Yubikey.
Refer to this support article, Access Server: PKCS#11 hardware tokens for VPN connections, for a detailed tutorial on setting up Yubikey hardware tokens for Access Server.
Before you begin
Make sure you've already done the following:
Installed OpenVPN Connect on Windows or macOS.
Important
Your profile should not contain <cert> and <key>. That way, you can assign an external certificate loaded on the hardware token.
Installed the hardware token management software. (Refer to the Yubikey site: Releases.)
Imported the private key and certificate pair on the hardware token. (Refer to the Yubikey site: key import.)
Important
Ensure you import the private key and certificate in the same slot on the token.
Find your operating system below and follow the steps.
macOS
Locate the library:
/usr/local/lib/libykcs11.x.x.x.dylib
Example 1.E.g., libykcs11.2.3.0.dylib — ensure it's a file, not a symlink.
Open Terminal and execute this command to create a symlink to the library file:
ln -s /usr/local/lib/libykcs11.x.x.x1.dylib ~/.pkcs11_modules/libykcs11.dylib
Where x.x.x is the version of the file from step one. |
Windows
Add
<Program Files>\Yubico\Yubico PIV Tool\bin
to $PATH environment variable (System).Copy
<Program Files>\Yubico\Yubico PIV Tool\bin\libykcs11.dll
to<Program Files>\OpenVPN Connect\pkcs11_modules
.
For both macOS and Windows, exit out of OpenVPN Connect and then follow these steps:
Launch OpenVPN Connect.
Click or tap the Edit icon for the desired profile.
Under Certificate and Key, click or tap Assign.
Tip
If Certificate and Key doesn't display, your connection profile already includes the certificate and key. Your profile should not contain <cert> and <key>.
Click or tap Hardware Tokens and select the hardware token from the list.
Click or tap Authorize and enter a PIN for the desired hardware token.
After successful authorization, choose the certificate and key for connection with the profile.
Click or tap Confirm.
Save the profile configuration.
Now that you have a proper certificate and key assigned to the profile, you can plug in your hardware token and connect using your profile:
Click or tap the profile toggle to connect.
After a successful connection, OpenVPN Connect displays connection statistics.
Important
Keep the hardware token plugged in during the connection process.