Create CA + 2 Certificates with XCA

Abstract: Establishes local PKI with XCA to enable host-to-host IPSec authentication without Active Directory.

Created: 2026-09-20 by

To configure host-to-host IPSec authentication without Active Directory, you must first establish a local Certificate Authority using XCA, then generate two distinct certificates: one for the CA itself and another for each endpoint. These certificates enable mutual authentication between Windows machines by verifying identity through trusted root signatures rather than pre-shared keys.

Installing and Configuring XCA

XCA is a free, open-source certificate manager that simplifies the creation of private keys and certificates on Windows systems where no enterprise PKI exists. Begin by downloading the latest stable release from the official XCA website. During installation, ensure you select the option to install the necessary cryptographic service providers if prompted.

Once installed, launch XCA as an administrator. The first critical step is to create a new database file. Navigate to File > New Database. Save this file in a secure location, such as C:\XCA\MyCA.xca, because losing this file means losing your entire trust chain. You will be prompted to set a password for the database master key. Choose a strong password and store it safely; without it, you cannot export private keys or modify the database.

Creating the Root Certificate Authority

With the database open, you need to generate the Root CA certificate. Go to Keys > New Key. In the dialog box, provide a meaningful name like LocalRootCA. Ensure the algorithm is set to RSA with a minimum bit length of 2048, though 4096 is recommended for long-term security. Click OK to generate the key pair.

Next, create the certificate request. Select the newly created key and go to Certificates > New Certificate. Set the Subject Name to match your organization or hostname, for example, CN=Local Root CA. Crucially, under the Extensions tab, locate the Basic Constraints extension. Check the box for CA:TRUE. This setting is mandatory; without it, the certificate cannot sign other certificates, and IPSec peers will reject it as invalid. Set the Validity Period to a reasonable duration, such as 10 years, since this is a self-signed root. Sign the certificate using the key you just generated. Your Root CA is now ready.

Generating Endpoint Certificates for IPSec

You now need two client certificates, one for each host involved in the IPSec tunnel. Repeat the process of creating a new key for each machine. Name them descriptively, such as HostA_Key and HostB_Key.

For each key, create a new certificate request. In the Subject Name, use the specific hostname of the machine, e.g., CN=HostA. Under the Extensions tab, you must add the Enhanced Key Usage (EKU) extension. Add both Client Authentication and Server Authentication OIDs. This dual usage allows the certificate to be used for initiating or responding to IPSec connections. Without these EKUs, Windows may refuse to present the certificate during negotiation.

When signing these certificates, do not use the Root CA key directly in the same session if you want to simulate a real-world hierarchy. Instead, import the Root CA certificate into the "Trusted Root" section of XCA's database, then select it as the signer. This ensures the chain of trust is properly established within the tool. Export the resulting certificates as .cer files for the public part and .pfx files for the private parts, ensuring you protect the PFX files with passwords.

Exporting Keys Correctly

Right-click the Root CA certificate and select Export > Export Certificate. Save it as a Base-64 encoded X.509 (.CER) file. This file will be installed on all hosts as the trusted root.

For the endpoint certificates, right-click the certificate and choose Export > Export Private Key. Select the PFX format. Include the full certificate chain if possible, but at minimum, include the private key and set a robust export password. Send the CER file and the corresponding PFX file securely to their respective target machines.

Configuring Windows IPSec Policies

On each Windows host, open Group Policy Management and edit the Local Group Policy. Navigate to Computer Configuration > Windows Settings > Security Settings > IP Security Policies on Local Computer.

Create a new IP Security Policy. Assign rules that specify the remote peer's IP address. In the rule settings, navigate to the Methods tab. Select Use Internet Key Exchange (IKE) and click Properties. Under the Authentication Methods tab, remove "Pre-Shared Key" and select Certificate Authentication. Ensure "Negotiate Public Key" is checked.

Install the Root CA .CER file into the Trusted Root Certification Authorities store on both machines. Then, import the endpoint .PFX file into the Personal store of the local computer account. Finally, assign the policy to the network adapters. When connecting, Windows will automatically negotiate the IPSec tunnel using the certificates you created.

Troubleshooting Common Issues

If the connection fails, check the Event Viewer under Applications and Services Logs > Microsoft > Windows > IKEEXT. Look for errors indicating certificate validation failures. Common causes include mismatched hostnames in the certificate Subject vs. the actual machine name, or missing EKU extensions. Ensure the time synchronization between hosts is accurate, as certificate validity checks rely heavily on system time.

Frequently Asked Questions

Can I use the same certificate for both machines?

No, each machine must have its own unique private key and certificate. Sharing certificates compromises security and prevents proper identification of the endpoint during the IKE handshake.

What happens if the Root CA expires?

If the Root CA certificate expires, all subordinate certificates signed by it become invalid. You would need to generate a new Root CA, re-sign all endpoint certificates, and redistribute them to all hosts.

Do I need to install the certificate in the User store?

For host-to-host IPSec, the certificate must be installed in the Local Computer Personal store, not the Current User store. IPSec policies operate at the system level and require access to the computer's identity.

Why did my IPSec negotiation fail with error 1380?

Error 1380 typically indicates that the certificate presented does not meet the required criteria, often due to missing Extended Key Usage extensions. Verify that both Client and Server Auth OIDs are present in the certificate extensions.

Is XCA safe for production environments?

XCA is suitable for small-scale or lab environments where Active Directory is unavailable. For large enterprises, consider deploying an internal Enterprise PKI using Windows Server AD CS for centralized management and automation.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More