The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This document describes how to request, install, trust, and renew, certain types of certificates on Cisco ASA Software managed with CLI.
Cisco recommends that you have knowledge of these topics:
The information in this document is based on these software and hardware versions:
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
The type of certificates this document addresses are self-signed certificates, certificates signed by a 3rd party Certificate Authority, or internal CA, on Cisco Adaptive Security Appliance Software managed with Command Line Interface (CLI).
When a trusted CA certificate is installed, with crypto ca trustpoint authenticate,
it can be used to authenticate different types of VPN connections using certificate authentication. It is controlled with validation-usage
trustpoint command. The validation-usage types are:
By default, the command allows validation for ipsec-client and ssl-client.
Disable validation-usage for unintended trustpoints. If a CA certificate is not meant to authenticate VPN peers or users, disable validation-usage for that trustpoint.
trustpoint public-root-ca no validation-usage
By default, a trusted CA certificate can be used to authenticate VPN peer or user connecting to any tunnel-group. Proper authorization needs to be designed.
Use certificate maps and tunnel-group maps to ensure only authorized certificates are used for specific tunnel groups. Set a default tunnel group map rule, that points to a no-access tunnel group to restrict unauthorized access.
Certificate authentication is only allowed for:
Users with other certificates are assigned to no_access tunnel-group by default, thanks to tunnel-group-map default-group no_access
command. The Certificate Map Rules have priority over group-url thanks to tunnel-group-map enable rules
command. Knowing group-url does not help to bypass the Certificate Map Rules.
! Configure group-policy preventing VPN access:
group-policy no_access_gp internal group-policy no_access_gp attributes banner value NO ACCESS GROUP POLICY (...) vpn-simultaneous-logins 0 !
! Configure tunnel-groups for users:
tunnel-group mgmt-tunnel type remote-access tunnel-group mgmt-tunnel general-attributes address-pool vpn_pool default-group-policy mgmt-tunnel tunnel-group mgmt-tunnel webvpn-attributes authentication certificate group-url https://ftd.example.com/mgmt enable ! tunnel-group users_access type remote-access tunnel-group users_access general-attributes default-group-policy user_access_gp address-pool vpn_pool tunnel-group users_access webvpn-attributes authentication certificate group-url https://ftd.example.com/users enable !
! Configure tunnel-group preventing VPN access:
tunnel-group no_access type remote-access tunnel-group no_access general-attributes default-group-policy no_access_gp address-pool vpn_pool tunnel-group no_access webvpn-attributes authentication certificate !
! Create certificate maps for users:
crypto ca certificate map mgmt_tunnel_map 10 issuer-name attr cn eq example.com subject-name attr ou eq machines
! crypto ca certificate map users_access_map 10 issuer-name attr cn eq example.com subject-name attr ou eq users !
! Configure webvpn to use the certificate maps for tunnel-group mapping:
webvpn (...) certificate-group-map mgmt_tunnel_map 10 mgmt-tunnel certificate-group-map users_access_map 10 users_access !
! Enable tunnel-group maps and set the default tunnel-group preventing access if a user certificate did not match any other certificate map:
tunnel-group-map enable rules tunnel-group-map default-group no_access
!
For more detailed configuration instructions, refer to Cisco documentation:
Note: By default, the RSA key with the name of Default-RSA-Key and a size of 2048 is used; however, it is recommended to use a unique name for each certificate so that they do not use the same private/public keypair.
ASAv(config)# crypto key generate rsa label SELF-SIGNED-KEYPAIR modulus 2048 INFO: The name for the keys will be: SELF-SIGNED-KEYPAIR Keypair generation process begin. Please wait...
The generated keypair can be seen with command show crypto key mypubkey rsa.
ASAv# show crypto key mypubkey rsa (...) Key pair was generated at: 14:52:49 CEDT Jul 15 2022 Key name: SELF-SIGNED-KEYPAIR Usage: General Purpose Key Key Size (bits): 2048 Storage: config Key Data: 30820122 300d0609 2a864886 f70d0101 01050003 82010f00 3082010a 02820101 ... 59dcd7d7 c3ee77f5 bbd0988d 515e390e b8d95177 dfaf6b94 a9df474b 1ec3b4a4 af020301 0001
ASAv(config)# crypto ca trustpoint SELF-SIGNED ASAv(config-ca-trustpoint)# enrollment self
Caution: The FQDN parameter must match the FQDN or the IP address of the ASA interface that the certificate is used for. This parameter sets the Subject Alternative Name (SAN) for the certificate.
ASAv(config-ca-trustpoint)# fqdn asavpn.example.com ASAv(config-ca-trustpoint)# subject-name CN=asavpn.example.com,O=Example Inc,C=US,St=California,L=San Jose
ASAv(config-ca-trustpoint)# keypair SELF-SIGNED-KEYPAIR ASAv(config-ca-trustpoint)# exit
ASAv(config)# crypto ca enroll SELF-SIGNED WARNING: The certificate enrollment is configured with an fqdn that differs from the system fqdn. If this certificate will be used for VPN authentication this may cause connection problems. Would you like to continue with this enrollment? [yes/no]: yes % The fully-qualified domain name in the certificate will be: asa.example.com % Include the device serial number in the subject name? [yes/no]: no Generate Self-Signed Certificate? [yes/no]: yes ASAv(config)# exit
show crypto ca certificates <truspoint name>
.
ASAv# show crypto ca certificates SELF-SIGNED Certificate Status: Available Certificate Serial Number: 62d16084 Certificate Usage: General Purpose Public Key Type: RSA (2048 bits) Signature Algorithm: RSA-SHA256 Issuer Name: unstructuredName=asa.example.com L=San Jose ST=California C=US O=Example Inc CN=asa.example.com Subject Name: unstructuredName=asa.example.com L=San Jose ST=California C=US O=Example Inc CN=asa.example.com Validity Date: start date: 15:00:58 CEDT Jul 15 2022 end date: 15:00:58 CEDT Jul 12 2032 Storage: config Associated Trustpoints: SELF-SIGNED
Note: By default, the RSA key with the name of Default-RSA-Key and a size of 2048 is used; however, it is recommended to use a unique name for each certificate so that they do not use the same private/public keypair.
ASAv(config)# crypto key generate rsa label CA-SIGNED-KEYPAIR modulus 2048 INFO: The name for the keys will be: CA-SIGNED-KEYPAIR Keypair generation process begin. Please wait...
The generated keypair can be seen with command show crypto key mypubkey rsa.
ASAv# show crypto key mypubkey rsa (...) Key pair was generated at: 14:52:49 CEDT Jul 15 2022 Key name: CA-SIGNED-KEYPAIR Usage: General Purpose Key Key Size (bits): 2048 Storage: config Key Data: 30820122 300d0609 2a864886 f70d0101 01050003 82010f00 3082010a 02820101 ... 59dcd7d7 c3ee77f5 bbd0988d 515e390e b8d95177 dfaf6b94 a9df474b 1ec3b4a4 af020301 0001
ASAv(config)# crypto ca trustpoint CA-SIGNED ASAv(config-ca-trustpoint)# enrollment terminal
ASAv(config-ca-trustpoint)# fqdn asavpn.example.com ASAv(config-ca-trustpoint)# subject-name CN=asavpn.example.com,O=Example Inc,C=US,St=California,L=San Jose
ASAv(config-ca-trustpoint)# keypair CA-SIGNED-KEYPAIR
ASAv(config-ca-trustpoint)# revocation-check ocsp
ASAv(config)# crypto ca authenticate CA-SIGNED Enter the base 64 encoded CA certificate. End with the word "quit" on a line by itself ASAv(config)# crypto ca authenticate CA-SIGNED Enter the base 64 encoded CA certificate. End with the word "quit" on a line by itself -----BEGIN CERTIFICATE----- MIIDXDCCAkSgAwIBAgIIDM/QY/h29+kwDQYJKoZIhvcNAQELBQAwRTELMAkGA1UE BhMCUEwxDzANBgNVBAoTBnd3LXZwbjEMMAoGA1UECxMDbGFiMRcwFQYDVQQDEw5j YS5leGFtcGxlLmNvbTAeFw0xNTAyMDYxNDEwMDBaFw0zMDAyMDYxNDEwMDBaMEUx CzAJBgNVBAYTAlBMMQ8wDQYDVQQKEwZ3dy12cG4xDDAKBgNVBAsTA2xhYjEXMBUG A1UEAxMOY2EuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK AoIBAQDI6pth5KFFTB29LynOg9/CTiOGYa+WFTcZXSLHZA6WTUzLYM19IbSFHWa6 gTeBnHqToLRnQoB51QlxEA45ArL2G98aew8BMD08GXkxWayforwLA3U9WZVTZsVN 4noWaXH1boGGD7+5vk0esJfL2B7pEhGodLh7Gki1T4KoqL/lDM9LqkzOctZkCT7f SkXvFik1Z1cZEGn6b2umnIqaVZ81ewIuTHOX48ls3uxTPH8+B5QG0+d1waOsbCWk oK5sEPpHZ3IQuVxGiirp/zmomzxl4G/tel6eyMOpjpnVtDYjQ9HNkQdQT5LKwRsX Oj9xKnYCbPfg3p2FdH7wJh1lK3prAgMBAAGjUDBOMAwGA1UdEwQFMAMBAf8wHQYD VR0OBBYEFE55kZsbra9b9tLFV52U47em9uXaMB8GA1UdIwQYMBaAFE55kZsbra9b 9tLFV52U47em9uXaMA0GCSqGSIb3DQEBCwUAA4IBAQArsXlFwK3jlNBwOsYh5mqT cGqeyDMRhs3Rs/wD25M2wkAF4AYZHgN9gK9VCK+ModKMQZy4X/uhj65NDU7oFf6f z9kqaRijsx153jV/YLk8E9oAIatnA/fQfX6V+h74yqucfF1js3d1FjyV14odRPwM 0jRyjalH56BFlackNc7KRddtVxYB9sfEbFhN8odlBvnUedxGAJFHqxEQKmBE+h4w gW8YnHOvM08svyTXSLlJf0UCdmAY+lG0gqhUlSlkFBtLRt6Z2uCot00NoMHI0hh5 dcVcovOi/PAxnrAlJ+Ng2jrWFN3MXWZO4S3CHYMGkWqHkaHChlqDOx9badgfsyzz -----END CERTIFICATE----- quit INFO: Certificate has these attributes: Fingerprint: e9ad165c 2673424c 6e7e0c5f b30b4a02 Do you accept this certificate? [yes/no]: yes WARNING: CA certificates can be used to validate VPN connections, by default. Please adjust the validation-usage of this trustpoint to limit the validation scope, if necessary. Trustpoint CA certificate accepted. % Certificate successfully imported
Note: CA can alter the FQDN and Subject Name parameters defined in the trustpoint when signing the CSR and creating signed identity certificate.
ASAv(config)# crypto ca enroll CA-SIGNED WARNING: The certificate enrollment is configured with an fqdn that differs from the system fqdn. If this certificate will be used for VPN authentication this may cause connection problems. Would you like to continue with this enrollment? [yes/no]: yes % Start certificate enrollment .. % The subject name in the certificate will be: CN=asavpn.example.com,O=Example Inc,C=US,St=California,L=San Jose % The fully-qualified domain name in the certificate will be: asavpn.example.com % Include the device serial number in the subject name? [yes/no]: no Display Certificate Request to terminal? [yes/no]: yes Certificate Request follows: -----BEGIN CERTIFICATE REQUEST----- MIIDHzCCAgcCAQAwgYsxGzAZBgNVBAMMEmFzYXZwbi5leGFtcGxlLmNvbTEUMBIG A1UECgwLRXhhbXBsZSBJbmMxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9y bmlhMREwDwYDVQQHDAhTYW4gSm9zZTEhMB8GCSqGSIb3DQEJAgwSYXNhdnBuLmV4 YW1wbGUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5cvZVr1j Me8Mz4T3vgT1Z8DAAR0avs/TBdYiqGdjyiV/3K92IIT/0r8cuAUe5rR4sjTvaXYC SycSbwKc4kZbr3x120ss8Itd5g4kBdrUSCprl+VMiTphQgBTAqRPk0vFX4rC8k/T 0PFDE+2gjT1wMn9reb92jYrolGK4MWZdCzqowLPjEj5cCwu8Pv5h4hqTpudms+v4 g3R1OODmeyv4uEMYLS/noPxZXZ8YiQMiG2EP2Bg0KOT3Fzx0mVuekonQtRhiZt+c zyyfSRoqyBSakEZBwABod8q1Eg5J/pH130JlitOUJEyIlFoVHqv3jL7zfA9ilInu NaHkir062VQNXwIDAQABoE4wDwYJKoZIhvcNAQkHMQITADA7BgkqhkiG9w0BCQ4x LjAsMAsGA1UdDwQEAwIFoDAdBgNVHREEFjAUghJhc2F2cG4uZXhhbXBsZS5jb20w DQYJKoZIhvcNAQELBQADggEBAM3Q3zvp9G3MWP7R4wkpnBOH2CNUmPENIhHNjQjH Yh08EOvWyoo9FaLfHKVDLvFXh0vn5osXBmPLuVps6Ta4sBRUNicRoAmmA0pDWL9z Duu8BQnBGuN08T/H3ydjaNoPJ/f6EZ8gXY29NXEKb/+A2Tt0VVUTsYreGS+84Gqo ixFOtW8R50IXg+afAVOAh81xVUFOvuAi9DsiuvufMb4wdngQSOel/B9Zgp/BfGMl l0ApgejACoJAGmyrn9Tj6Z/6/lbpKBKpf4VE5UXdj7WLAjw5JF/X2NrH3/cQsczi G2Yg2dr3WpkTIY2W/kVohTiohVRkgXOMCecUaMlYxJyLTRQ= -----END CERTIFICATE REQUEST----- Redisplay enrollment request? [yes/no]: no
ASAv(config)# crypto ca import CA-SIGNED certificate WARNING: The certificate enrollment is configured with an fqdn that differs from the system fqdn. If this certificate will be used for VPN authentication this may cause connection problems.
Would you like to continue with this enrollment? [yes/no]: yes % The fully-qualified domain name in the certificate will be: asavpn.example.com Enter the base 64 encoded certificate. End with the word "quit" on a line by itself -----BEGIN CERTIFICATE----- MIIDoTCCAomgAwIBAgIIKbLY8Qt8N5gwDQYJKoZIhvcNAQELBQAwRTELMAkGA1UE BhMCUEwxDzANBgNVBAoTBnd3LXZwbjEMMAoGA1UECxMDbGFiMRcwFQYDVQQDEw5j (...) kzAihRuFqmYYUeQP2Byp/S5fNqUcyZfAczIHt8BcPmVO9l6iSF/ULGlzXMSOUX6N d/LHXwrcTpc1zU+7qx3TpVDZbJlwwF+BWTBlxgM0BosJx65u/n75KnbBhGUE75jV HX2eRzuhnnSVExCoeyed7DLiezD8 -----END CERTIFICATE----- quit INFO: Certificate successfully imported
show crypto ca certificates <trustpoint name>
.
ASAv# show crypto ca certificates CA-SIGNED CA Certificate Status: Available Certificate Serial Number: 0ccfd063f876f7e9 Certificate Usage: General Purpose Public Key Type: RSA (2048 bits) Signature Algorithm: RSA-SHA256 Issuer Name: CN=ca.example.com OU=lab O=ww-vpn C=PL Subject Name: CN=ca.example.com OU=lab O=ww-vpn C=PL Validity Date: start date: 15:10:00 CEST Feb 6 2015 end date: 15:10:00 CEST Feb 6 2030 Storage: config Associated Trustpoints: CA-SIGNED Certificate Status: Available Certificate Serial Number: 29b2d8f10b7c3798 Certificate Usage: General Purpose Public Key Type: RSA (2048 bits) Signature Algorithm: RSA-SHA256 Issuer Name: CN=ca.example.com OU=lab O=ww-vpn C=PL Subject Name: unstructuredName=asavpn.example.com L=San Jose ST=California C=US O=Example Inc CN=asavpn.example.com Validity Date: start date: 15:33:00 CEDT Jul 15 2022 end date: 15:33:00 CEDT Jul 15 2023 Storage: config Associated Trustpoints: CA-SIGNED
Enroll with the PKCS12 file that contains keypair, identity certificate, and optionally CA certificate(s) chain, received from your CA.
ASAv(config)# crypto ca trustpoint Trustpoint-PKCS12 ASAv(config-ca-trustpoint)# exit
Note: The imported keypair is named after the trustpoint name.
ASAv(config-ca-trustpoint)# revocation-check ocsp
Note: The PKCS12 file needs to be base64 encoded. If printable characters are seen when file is opened in text editor, then it is base64 encoded. To convert a binary file to base64 encoded form openssl can be used.
openssl enc -base64 -in asavpnpkcs12chain.example.com.pfx -out asavpnpkcs12chain.example.com.pfx.txtCommand:
crypto ca import trustpoint pkcs12 passphrase [ nointeractive ]
ASAv(config)# crypto ca import TP-PKCS12 pkcs12 cisco123 Enter the base 64 encoded pkcs12. End with the word "quit" on a line by itself: MIIN4gIBAzCCDawGCSqGSIb3DQEHAaCCDZ0Egg2ZMIINlTCCCBcGCSqGSIb3DQEH BqCCCAgwgggEAgEAMIIH/QYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQIiK0c wqE3Tm0CAggAgIIH0NjxmJBuoPRuYl1VxTiawHzsL8kIl03lOj7tcWmECBwzsKKq (...) PXowMwYJKoZIhvcNAQkUMSYeJABhAHMAYQB2AHAAbgAuAGUAeABhAG0AcABsAGUA LgBjAG8AbTAtMCEwCQYFKw4DAhoFAAQUPXZZtBeqlh98wQljHW7J/hqoKcwECD05 dnxCNJx6 quit Trustpoint CA certificate accepted. WARNING: CA certificates can be used to validate VPN connections, by default. Please adjust the validation-usage of this trustpoint to limit the validation scope, if necessary. INFO: Import PKCS12 operation completed successfully.
ASAv# show crypto ca certificates TP-PKCS12 Certificate Status: Available Certificate Serial Number: 2b368f75e1770fd0 Certificate Usage: General Purpose Public Key Type: RSA (2048 bits) Signature Algorithm: RSA-SHA256 Issuer Name: CN=ca.example.com OU=lab O=ww-vpn C=PL Subject Name: unstructuredName=asavpn.example.com CN=asavpnpkcs12chain.example.com O=Example Inc L=San Jose ST=California C=US Validity Date: start date: 15:33:00 CEDT Jul 15 2022 end date: 15:33:00 CEDT Jul 15 2023 Storage: config Associated Trustpoints: TP-PKCS12 CA Certificate Status: Available Certificate Serial Number: 0ccfd063f876f7e9 Certificate Usage: General Purpose Public Key Type: RSA (2048 bits) Signature Algorithm: RSA-SHA256 Issuer Name: CN=ca.example.com OU=lab O=ww-vpn C=PL Subject Name: CN=ca.example.com OU=lab O=ww-vpn C=PL Validity Date: start date: 15:10:00 CEST Feb 6 2015 end date: 15:10:00 CEST Feb 6 2030 Storage: config Associated Trustpoints: TP-PKCS12
In the previous example, the PKCS12 contained the identity and CA certificate - the two entries - Certificate and CA Certificate. Otherwise, only Certificate is present.
If the PKCS12 did not contain the CA certificate, and the CA certificate was obtained separately in PEM format, then it can be installed manually.
ASAv(config)# crypto ca authenticate TP-PKCS12 Enter the base 64 encoded CA certificate. End with the word "quit" on a line by itself -----BEGIN CERTIFICATE----- MIIDXDCCAkSgAwIBAgIIDM/QY/h29+kwDQYJKoZIhvcNAQELBQAwRTELMAkGA1UE BhMCUEwxDzANBgNVBAoTBnd3LXZwbjEMMAoGA1UECxMDbGFiMRcwFQYDVQQDEw5j (...) gW8YnHOvM08svyTXSLlJf0UCdmAY+lG0gqhUlSlkFBtLRt6Z2uCot00NoMHI0hh5 dcVcovOi/PAxnrAlJ+Ng2jrWFN3MXWZO4S3CHYMGkWqHkaHChlqDOx9badgfsyzz -----END CERTIFICATE----- quit INFO: Certificate has these attributes: Fingerprint: e9ad165c 2673424c 6e7e0c5f b30b4a02 Do you accept this certificate? [yes/no]: yes WARNING: CA certificates can be used to validate VPN connections, by default. Please adjust the validation-usage of this trustpoint to limit the validation scope, if necessary. Trustpoint CA certificate accepted. % Certificate successfully imported
# show crypto ca certificates SELF-SIGNED Certificate Status: Available Certificate Serial Number: 62d16084 Certificate Usage: General Purpose Public Key Type: RSA (2048 bits) Signature Algorithm: RSA-SHA256 Issuer Name: unstructuredName=asa.example.com L=San Jose ST=California C=US O=Example Inc CN=asa.example.com Subject Name: unstructuredName=asa.example.com L=San Jose ST=California C=US O=Example Inc CN=asa.example.com Validity Date: start date: 15:00:58 CEDT Jul 15 2022 end date: 15:00:58 CEDT Jul 12 2032 Storage: config Associated Trustpoints: SELF-SIGNED
ASAv# conf t ASAv(config)# crypto ca enroll SELF-SIGNED WARNING: The certificate enrollment is configured with an fqdn that differs from the system fqdn. If this certificate will be used for VPN authentication this may cause connection problems. Would you like to continue with this enrollment? [yes/no]: yes WARNING: Trustpoint TP has already enrolled and has a device cert issued to it. If you successfully re-enroll this trustpoint, the current certificate will be replaced. Do you want to continue with re-enrollment? [yes/no]: yes % The fully-qualified domain name in the certificate will be: asa.example.com % Include the device serial number in the subject name? [yes/no]: no Generate Self-Signed Certificate? [yes/no]: yes ASAv(config)# exit
ASAv# show crypto ca certificates SELF-SIGNED Certificate Status: Available Certificate Serial Number: 62d16085 Certificate Usage: General Purpose Public Key Type: RSA (2048 bits) Signature Algorithm: RSA-SHA256 Issuer Name: unstructuredName=asa.example.com L=San Jose ST=California C=US O=Example Inc CN=asa.example.com Subject Name: unstructuredName=asa.example.com L=San Jose ST=California C=US O=Example Inc CN=asa.example.com Validity Date: start date: 15:09:09 CEDT Jul 20 2022 end date: 15:09:09 CEDT Jul 17 2032 Storage: config Associated Trustpoints: SELF-SIGNED
Note: If any of the new certificate elements (subject/fqdn, keypair) need to be changed for the new certificate, then create a new certificate. Refer to Enrollment using Certificate Signing Request (CSR) section. The next procedure just refreshes the certificate expiry date.
ASAv# show crypto ca certificates CA-SIGNED Certificate Status: Available Certificate Serial Number: 29b2d8f10b7c3798 Certificate Usage: General Purpose Public Key Type: RSA (2048 bits) Signature Algorithm: RSA-SHA256 Issuer Name: CN=ca.example.com OU=lab O=ww-vpn C=PL Subject Name: unstructuredName=asavpn.example.com L=San Jose ST=California C=US O=Example Inc CN=asavpn.example.com Validity Date: start date: 15:33:00 CEDT Jul 15 2022 end date: 15:33:00 CEDT Jul 15 2023 Storage: config Associated Trustpoints: CA-SIGNED Certificate Subject Name: Status: Pending terminal enrollment Key Usage: General Purpose Fingerprint: 790aa617 c30c6894 0bdc0327 0d60b032 Associated Trustpoint: CA-SIGNED
Note: CA can alter the FQDN and Subject Name parameters defined in the trustpoint when signing the CSR and creating signed identity certificate.
Note: For the same Trustpoint, with no changed subject/fqdn and keypair configuration, subsequent enrollments give the same CSR as the initial one.
ASAv# conf t ASAv(config)# crypto ca enroll CA-SIGNED WARNING: The certificate enrollment is configured with an fqdn that differs from the system fqdn. If this certificate will be used for VPN authentication this may cause connection problems. Would you like to continue with this enrollment? [yes/no]: yes % Start certificate enrollment .. % The subject name in the certificate will be: CN=asavpn.example.com,O=Example Inc,C=US,St=California,L=San Jose % The fully-qualified domain name in the certificate will be: asavpn.example.com % Include the device serial number in the subject name? [yes/no]: no Display Certificate Request to terminal? [yes/no]: yes Certificate Request follows: -----BEGIN CERTIFICATE REQUEST----- MIIDHzCCAgcCAQAwgYsxGzAZBgNVBAMMEmFzYXZwbi5leGFtcGxlLmNvbTEUMBIG A1UECgwLRXhhbXBsZSBJbmMxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9y bmlhMREwDwYDVQQHDAhTYW4gSm9zZTEhMB8GCSqGSIb3DQEJAgwSYXNhdnBuLmV4 YW1wbGUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5cvZVr1j Me8Mz4T3vgT1Z8DAAR0avs/TBdYiqGdjyiV/3K92IIT/0r8cuAUe5rR4sjTvaXYC SycSbwKc4kZbr3x120ss8Itd5g4kBdrUSCprl+VMiTphQgBTAqRPk0vFX4rC8k/T 0PFDE+2gjT1wMn9reb92jYrolGK4MWZdCzqowLPjEj5cCwu8Pv5h4hqTpudms+v4 g3R1OODmeyv4uEMYLS/noPxZXZ8YiQMiG2EP2Bg0KOT3Fzx0mVuekonQtRhiZt+c zyyfSRoqyBSakEZBwABod8q1Eg5J/pH130JlitOUJEyIlFoVHqv3jL7zfA9ilInu NaHkir062VQNXwIDAQABoE4wDwYJKoZIhvcNAQkHMQITADA7BgkqhkiG9w0BCQ4x LjAsMAsGA1UdDwQEAwIFoDAdBgNVHREEFjAUghJhc2F2cG4uZXhhbXBsZS5jb20w DQYJKoZIhvcNAQELBQADggEBAM3Q3zvp9G3MWP7R4wkpnBOH2CNUmPENIhHNjQjH Yh08EOvWyoo9FaLfHKVDLvFXh0vn5osXBmPLuVps6Ta4sBRUNicRoAmmA0pDWL9z Duu8BQnBGuN08T/H3ydjaNoPJ/f6EZ8gXY29NXEKb/+A2Tt0VVUTsYreGS+84Gqo ixFOtW8R50IXg+afAVOAh81xVUFOvuAi9DsiuvufMb4wdngQSOel/B9Zgp/BfGMl l0ApgejACoJAGmyrn9Tj6Z/6/lbpKBKpf4VE5UXdj7WLAjw5JF/X2NrH3/cQsczi G2Yg2dr3WpkTIY2W/kVohTiohVRkgXOMCecUaMlYxJyLTRQ= -----END CERTIFICATE REQUEST----- Redisplay enrollment request? [yes/no]: no
ASAv(config)# crypto ca import CA-SIGNED certificate WARNING: The certificate enrollment is configured with an fqdn that differs from the system fqdn. If this certificate will be used for VPN authentication this may cause connection problems. Would you like to continue with this enrollment? [yes/no]: yes % The fully-qualified domain name in the certificate will be: asavpn.example.com Enter the base 64 encoded certificate. End with the word "quit" on a line by itself -----BEGIN CERTIFICATE----- MIIDgTCCAmmgAwIBAgIIMA+aIxCtNtMwDQYJKoZIhvcNAQELBQAwRTELMAkGA1UE BhMCUEwxDzANBgNVBAoTBnd3LXZwbjEMMAoGA1UECxMDbGFiMRcwFQYDVQQDEw5j YS5leGFtcGxlLmNvbTAeFw0yMjA3MjAxNDA5MDBaFw0yMzA3MjAxNDA5MDBaMIGL MRswGQYDVQQDDBJhc2F2cG4uZXhhbXBsZS5jb20xFDASBgNVBAoMC0V4YW1wbGUg SW5jMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTERMA8GA1UEBwwI U2FuIEpvc2UxITAfBgkqhkiG9w0BCQIMEmFzYXZwbi5leGFtcGxlLmNvbTCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOXL2Va9YzHvDM+E974E9WfAwAEd Gr7P0wXWIqhnY8olf9yvdiCE/9K/HLgFHua0eLI072l2AksnEm8CnOJGW698ddtL LPCLXeYOJAXa1Egqa5flTIk6YUIAUwKkT5NLxV+KwvJP09DxQxPtoI09cDJ/a3m/ do2K6JRiuDFmXQs6qMCz4xI+XAsLvD7+YeIak6bnZrPr+IN0dTjg5nsr+LhDGC0v 56D8WV2fGIkDIhthD9gYNCjk9xc8dJlbnpKJ0LUYYmbfnM8sn0kaKsgUmpBGQcAA aHfKtRIOSf6R9d9CZYrTlCRMiJRaFR6r94y+83wPYpSJ7jWh5Iq9OtlUDV8CAwEA AaMuMCwwCwYDVR0PBAQDAgWgMB0GA1UdEQQWMBSCEmFzYXZwbi5leGFtcGxlLmNv bTANBgkqhkiG9w0BAQsFAAOCAQEAfQUchY4UjhjkySMJAh7NT3TT5JJ4NzqW8qHa wNq+YyHR+sQ6G3vn+6cYCU87tqWlY3fXC27TwweREwMbq8NsJrr80hsChYby8kwE LnTkrN7dJBl7u5OVQ3DRjfmFrJ9LEUaYZx1HYvcS1kAeEeVB4VJwVzeujWepcmEM p7cB6veTcF9rulDVRImd0KYEOx+HYav2INT2udc0G1yDwml/mqdf0/ON2SpBBpnE gtiKshtsST/NAw25WjkrDIfN8uR2z5xpzxnEDUBoHOipGlgb1I6G1ARXWO+LwfBl n1QD5b/RdQOUbLCpfKNPdE/9wNnoXGDlJ7qfZxrO4T7ld2Idug== -----END CERTIFICATE----- quit INFO: Certificate successfully imported
ASAv# show crypto ca certificates CA-SIGNED Certificate Status: Available Certificate Serial Number: 300f9a2310ad36d3 Certificate Usage: General Purpose Public Key Type: RSA (2048 bits) Signature Algorithm: RSA-SHA256 Issuer Name: CN=ca.example.com OU=lab O=ww-vpn C=PL Subject Name: unstructuredName=asavpn.example.com L=San Jose ST=California C=US O=Example Inc CN=asavpn.example.com Validity Date: start date: 16:09:00 CEDT Jul 20 2022 end date: 16:09:00 CEDT Jul 20 2023 Storage: config Associated Trustpoints: CA-SIGNED
It is not possible to renew a certificate in trustpoint enrolled using PKCS12 file. To install a new certificate, a new trustpoint needs to be created.
ASAv(config)# crypto ca trustpoint Trustpoint-PKCS12-2022 ASAv(config-ca-trustpoint)# exit
ASAv(config-ca-trustpoint)# revocation-check ocsp
Note: The PKCS12 file needs to be base64 encoded. If printable characters are seen when file is opened in text editor, then it is base64 encoded. To convert a binary file to base64 encoded form, openssl can be used.
openssl enc -base64 -in asavpnpkcs12chain.example.com.pfx -out asavpnpkcs12chain.example.com.pfx.txt
ASAv(config)# crypto ca import TP-PKCS12-2022 pkcs12 cisco123 Enter the base 64 encoded pkcs12. End with the word "quit" on a line by itself: MIIN4gIBAzCCDawGCSqGSIb3DQEHAaCCDZ0Egg2ZMIINlTCCCBcGCSqGSIb3DQEH BqCCCAgwgggEAgEAMIIH/QYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQMwDgQIiK0c wqE3Tm0CAggAgIIH0NjxmJBuoPRuYl1VxTiawHzsL8kIl03lOj7tcWmECBwzsKKq (...) PXowMwYJKoZIhvcNAQkUMSYeJABhAHMAYQB2AHAAbgAuAGUAeABhAG0AcABsAGUA LgBjAG8AbTAtMCEwCQYFKw4DAhoFAAQUPXZZtBeqlh98wQljHW7J/hqoKcwECD05 dnxCNJx6 quit Trustpoint CA certificate accepted. WARNING: CA certificates can be used to validate VPN connections, by default. Please adjust the validation-usage of this trustpoint to limit the validation scope, if necessary. INFO: Import PKCS12 operation completed successfully.
Note: If the new PKCS12 file contains an identity certificate with the same keypair that was used with the old certificate, the new trustpoint refers to old keypair name.
Example:
ASAv(config)# crypto ca import TP-PKCS12-2022 pkcs12 cisco123 Enter the base 64 encoded pkcs12. End with the word "quit" on a line by itself: MIIN4gIBAzCCDawGCSqGSIb3DQEHAaCCDZ0Egg2ZMIINlTCCCBcGCSqGSIb3DQEH ... dnxCNJx6 quit WARNING: Identical public key already exists as TP-PKCS12 ASAv(config)# show run crypto ca trustpoint TP-PKCS12-2022 crypto ca trustpoint TP-PKCS12-2022 keypair TP-PKCS12 no validation-usage crl configure
ASAv# show crypto ca certificates TP-PKCS12-2022 Certificate Status: Available Certificate Serial Number: 2b368f75e1770fd0 Certificate Usage: General Purpose Public Key Type: RSA (2048 bits) Signature Algorithm: RSA-SHA256 Issuer Name: CN=ca.example.com OU=lab O=ww-vpn C=PL Subject Name: unstructuredName=asavpn.example.com CN=asavpnpkcs12chain.example.com O=Example Inc L=San Jose ST=California C=US Validity Date: start date: 15:33:00 CEDT Jul 15 2022 end date: 15:33:00 CEDT Jul 15 2023 Storage: config Associated Trustpoints: TP-PKCS12-2022 CA Certificate Status: Available Certificate Serial Number: 0ccfd063f876f7e9 Certificate Usage: General Purpose Public Key Type: RSA (2048 bits) Signature Algorithm: RSA-SHA256 Issuer Name: CN=ca.example.com OU=lab O=ww-vpn C=PL Subject Name: CN=ca.example.com OU=lab O=ww-vpn C=PL Validity Date: start date: 15:10:00 CEST Feb 6 2015 end date: 15:10:00 CEST Feb 6 2030 Storage: config Associated Trustpoints: TP-PKCS12-2022
In the previous example, the PKCS12 contained the identity certificate and the CA certificate, therefore, two entries are seen after the import: Certificate and CA Certificate. Otherwise, only Certificate entry is present.
If the PKCS12 did not contain the CA certificate, and the CA certificate was obtained separately in PEM format, then it can be installed manually.
ASAv(config)# crypto ca authenticate TP-PKCS12-2022 Enter the base 64 encoded CA certificate. End with the word "quit" on a line by itself -----BEGIN CERTIFICATE----- MIIDXDCCAkSgAwIBAgIIDM/QY/h29+kwDQYJKoZIhvcNAQELBQAwRTELMAkGA1UE BhMCUEwxDzANBgNVBAoTBnd3LXZwbjEMMAoGA1UECxMDbGFiMRcwFQYDVQQDEw5j (...) gW8YnHOvM08svyTXSLlJf0UCdmAY+lG0gqhUlSlkFBtLRt6Z2uCot00NoMHI0hh5 dcVcovOi/PAxnrAlJ+Ng2jrWFN3MXWZO4S3CHYMGkWqHkaHChlqDOx9badgfsyzz -----END CERTIFICATE----- quit INFO: Certificate has these attributes: Fingerprint: e9ad165c 2673424c 6e7e0c5f b30b4a02 Do you accept this certificate? [yes/no]: yes WARNING: CA certificates can be used to validate VPN connections, by default. Please adjust the validation-usage of this trustpoint to limit the validation scope, if necessary. Trustpoint CA certificate accepted. % Certificate successfully imported
Example:
ASAv# show running-config ssl trust-point ssl trust-point TP-PKCS12 ASAv# conf t ASAv(config)#ssl trust-point TP-PKCS12-2022 ASAv(config)#exit
Note: A trustpoint can be used in different configuration elements. Check your configuration where the old trustpoint is used.
How to configure time settings on an ASA.
Check this reference for the steps required to set up the time and date correctly on the ASA. CLI Book 1: Cisco Secure Firewall ASA Series General Operations CLI Configuration Guide, 9.18
Revision | Publish Date | Comments |
---|---|---|
4.0 |
27-Nov-2024 |
Section added, and updated for Machine Translation, and Formatting. |
2.0 |
09-Jul-2024 |
Updated Formatting. |
1.0 |
21-Mar-2023 |
Initial Release |