Use Cases
HomeIntegrityControlManagement CenterSolutions
  • Get Started
  • Integrity | Access
    • Auth. methods
      • LDAP (Username/Password)
      • LDAP (Username/Password) + OTP (SMTP)
      • LDAP (Username/Password) + OTP (SMS)
      • Swedish BankID
      • Microsoft Entra ID (SAMLSPBroker)
      • Certificate-Based Authentication
      • Foregin eID (SAMLSPBroker)
    • Auth. methods (SAML)
      • One-Time Password (OATH)
      • Inera IdP (SITHS) (SAMLSPBroker)
      • ID-porten (Norway) (SAML IdP with OIDC RP)
      • Multiple SAML IdP's configured
        • Multiple JSON files
    • Auth. methods (OIDC)
      • Static values (OIDC) - Test only
      • Swedish BankID (OIDC)
      • UID/PWD (OIDC)
    • Auth. methods (MISC)
      • Selector filtering
      • AuthZ control
      • External links and Cancel location
    • Add a Federation or SAML SP
  • Integrity | Portal
    • Portal
  • Integrity | Enrollment
    • Software token (OATH)
    • Best practice configuration
  • Integrity | Radius
    • UID/OATH token
    • UID/Password/OATH token
    • UID/Password/SMTP
  • Integrity | API
    • Swedish Siths eID
    • Oath Token
    • OIDC M2M Authentication & Token Service
  • Control | Applications
    • Password Reset
    • Password Reset for Entra ID
    • Password Reset for Google Workspace
  • OPERATION
    • Rolling upgrade - cluster
  • TROUBLESHOOTING
    • Wrong relaystate
  • Misc
    • Address configuration externally
    • ADFS
      • Protect Fortified ID apps
      • Install and configure Fortified ID ADFS adapter for Siths eID
      • Install and configure Fortified ID ADFS adapter for Oath
    • AWS
      • Protect AWS Cognito with eID MFA
      • Protect AWS IAM Identity Center with eID MFA
    • Customization
      • Overlay - WEB
      • Overlay - Portal
      • Overlay - Password Reset
      • Overlay - Enrollment
      • Logout page
    • Dependency-Track - protect with eID MFA and SSO
    • Digitala Nationella Prov (DNP) / Skolfederation
      • Active Directory Federation Services (ADFS) with BankID as step-up-method
      • Active Directory / LDAP with BankID as step-up-method
      • Entra ID (Azure AD) with BankID as step-up-method
      • Google with BankID as step-up-method
      • Generate eduPersonPrincipalName (eppn) and store in Google
      • Generate eduPersonPrincipalName (eppn) and store in Entra ID
      • Common configuration
    • Encrypt configuration secrets
    • Microsoft Entra
      • Protect Entra ID (Azure AD) with eID MFA
      • Entra External - Support for eID (SAML)
      • Entra External - Support for eID (OIDC)
    • Expressions
    • Google
      • Common configuration for Google Workspace - Directory API
      • Common configuration for Google Workspace - authentication for Fortified ID products
      • Delegated administration for Google Workspace - teacher updates student guardians
      • Delegated administration for Google Workspace - teacher updates student password
      • Protect Google Workspace with eID MFA
    • HTTPS
    • Protect sensitive data, such as social security numbers, through obfuscation
    • Reverse proxy
      • Install Apache Web Server on Windows
      • Add SSL certificate and enable https
      • Add a Fortified ID virtual host
      • mTLS in Apache HTTPD using a Self-Signed CA and Client Certificates
    • Set AuthnContextClassRef
    • Wiki.js - OpenID Connect (OIDC)
    • Add roles based on memberOf
Powered by GitBook
On this page
  • Overview
  • Prerequisites
  • Step 1: Create a Self-Signed CA Certificate
  • Step 2: Export the CA Certificate
  • Step 3: Create a Client Certificate
  • Step 4: Configure Apache HTTPD for mTLS on /access/authn/cert
  • Step 6: Import the client keystore
  • Conclusion
  1. Misc
  2. Reverse proxy

mTLS in Apache HTTPD using a Self-Signed CA and Client Certificates

Creating a Self-Signed CA and Client Certificate Using Keystore Explorer (PKCS#12) for mTLS in Apache HTTPD

PreviousAdd a Fortified ID virtual hostNextSet AuthnContextClassRef

Last updated 4 days ago

Overview

This guide walks you through the process of generating a self-signed Certificate Authority (CA) and a client certificate using Keystore Explorer, with certificates stored in PKCS#12 (.p12) format. These certificates will be used to enable mutual TLS (mTLS) authentication in Apache HTTPD for the specific path /access/authn/cert.

Prerequisites

Before you begin, ensure you have:

  • Keystore Explorer installed ()

  • Apache HTTPD installed and configured


Step 1: Create a Self-Signed CA Certificate

  1. Open Keystore Explorer and create a new keystore (PKCS#12 format).

  2. Click Tools → Generate Key Pair.

  3. Select RSA (2048-bit or higher) and click OK.

  4. Enter the Distinguished Name (DN) details (e.g., CN=MyCA, O=MyOrg, C=SE).

  5. Set the validity period (e.g., 3650 days for 10 years). Press Apply to update the years.

  6. Click Add Extensions

  7. Click Use Standard Template

  8. Select CA and click OK

  9. Click OK.

  10. Click OK.

  11. Keep or change the Alias. Click OK

  12. Set a password for the key pair and click OK.

  13. Click OK.

  14. Save the keystore (myCA.p12).

  15. Set a password for the keystore and click OK.


Step 2: Export the CA Certificate

  1. Open myCA.p12 in Keystore Explorer.

  2. Right-click the CA key pair → Export → Export Certificate Chain.

  3. Choose Head Only, X.509 and PEM format and save it as ca.cer.


Step 3: Create a Client Certificate

  1. Open myCA.p12 in Keystore Explorer.

  2. Right-click the CA key pair → Sign

  3. Select Sign new key pair, select (2048-bit or higher) and click OK.

  4. Set the validity period (e.g., 3650 days for 10 years). Press Apply to update the years.

  5. Enter the Distinguished Name (DN) details (e.g., CN=Client, O=MyOrg, C=SE).

  6. Click Add Extensions

  7. Click Use Standard Template

  8. Select SSL Client and click OK

  9. Click OK

  10. Click OK.

  11. Keep or change the Alias. Click OK

  12. Set a password for the key pair and click OK.

  13. Right-click the Client key pair → Export → Export Key Pair.

  14. Select PKCS#12, set a password for the key pair and the path for the Export File.

  15. Click Export.

  16. Save the keystore if you would like to keep the client certificate in the keystore.


Step 4: Configure Apache HTTPD for mTLS on /access/authn/cert

  1. Copy ca.crt to the Apache configuration directory.

  2. Edit the Apache configuration file (httpd.conf or ssl.conf) and add the following configuration:

    Add the ca certificate and disable TLS1.3, add our change the following settings:

    SSLCACertificateFile "${SRVROOT}/conf/ca.cer"
    SSLProtocol all -SSLv3 -TLSv1.3
    SSLProxyProtocol all -SSLv3 -TLSv1.3

    Add the Location section:

    <Location "/access/authn/cert">
       SSLVerifyClient require
       SSLVerifyDepth  10
       # clear the SSL_* values
       RequestHeader set SSL_CLIENT_CERT ""
       RequestHeader set SSL_CLIENT_VERIFY ""
       # add whatever SSL_* variables needed to pass to web application
       RequestHeader set SSL_CLIENT_CERT "%{SSL_CLIENT_CERT}s"
       RequestHeader set SSL_CLIENT_VERIFY "%{SSL_CLIENT_VERIFY}s"
       RequestHeader add X-Forwarded-Scheme https
    </Location>
  3. Restart Apache:

    systemctl restart httpd

Step 6: Import the client keystore

  1. Import the certificate to the OS using the OS tool.


Conclusion

You have successfully created a self-signed CA, a client certificate, and configured Apache HTTPD for mTLS authentication on the specific path /access/authn/cert using Keystore Explorer, with certificates stored in PKCS#12 (.p12) format.

Download