Thsi was initially posted in the Unifi Routing & Switching forum as it's relating to a USG-XG but I've had no luck there. Given the USG is really just an EdgeRouter (it runs EdgeOS) without the GUI I'm going to try posting it here in the hope someone has seen a similar issue and can point me in the right direction to get it fixed...
Background : The client needs to create a IKE V2 IPSEC VPN to a cisco ASA using certificate based authentication. I've figured out most of the necessary config and largely got it set up with one major hurdle - I cannot, no matter what I try, get it to accept the other side's certificate. I know Cisco had an issue with one version IoS but I've checked with the remote side and they are not running an affected version. They've also confirmed they have this particular cert in use already with other clients.
I did send this to UBNT support but got directed back to the forums. Any help would be appreciated.
Jim.
When connecting, we get the following (sanitised) :
07[KNL] creating acquire job for policy 185.**.**.**/32[ipencap] === 217.**.**.**/32[ipencap] with reqid {7}
16[IKE] initiating IKE_SA peer-217.**.**.**-tunnel-vti[4] to 217.**.**.**
16[ENC] generating IKE_SA_INIT request 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) ]
16[NET] sending packet: from 185.**.**.**[500] to 217.**.**.**[500] (308 bytes)
13[NET] received packet: from 217.**.**.**[500] to 185.**.**.**[500] (44 bytes)
13[ENC] parsed IKE_SA_INIT response 0 [ N(COOKIE) ]
13[IKE] initiating IKE_SA peer-217.**.**.**-tunnel-vti[4] to 217.**.**.**
13[ENC] generating IKE_SA_INIT request 0 [ N(COOKIE) SA KE No N(NATD_S_IP) N(NATD_D_IP) ]
13[NET] sending packet: from 185.**.**.**[500] to 217.**.**.**[500] (324 bytes)
15[NET] received packet: from 217.**.**.**[500] to 185.**.**.**[500] (1187 bytes)
15[ENC] parsed IKE_SA_INIT response 0 [ SA KE No V V N(NATD_S_IP) N(NATD_D_IP) CERTREQ V ]
15[IKE] received cert request for "C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Domain Validation Secure Server CA"
15[IKE] received cert request for "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Certificate Authority - G2"
15[IKE] received cert request for "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., OU=http://certs.godaddy.com/repository/, CN=Go Daddy Secure Certificate Authority - G2"
15[IKE] received 34 cert requests for an unknown ca
15[IKE] sending cert request for "C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Domain Validation Secure Server CA"
15[IKE] sending cert request for "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., OU=http://certs.godaddy.com/repository/, CN=Go Daddy Secure Certificate Authority - G2"
15[IKE] sending cert request for "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Certificate Authority - G2"
15[IKE] authentication of 'OU=Domain Control Validated, OU=PositiveSSL, CN=gateway.THIS_ROUTER.co.uk' (myself) with RSA signature successful
15[IKE] sending end entity cert "OU=Domain Control Validated, OU=PositiveSSL, CN=gateway.THIS_ROUTER.co.uk"
15[IKE] establishing CHILD_SA peer-217.**.**.**-tunnel-vti
15[ENC] generating IKE_AUTH request 1 [ IDi CERT N(INIT_CONTACT) CERTREQ IDr AUTH SA TSi TSr N(MOBIKE_SUP) N(ADD_4_ADDR) N(ADD_4_ADDR) N(ADD_4_ADDR) N(ADD_4_ADDR) N(ADD_4_ADDR) N(EAP_ONLY) ]
15[NET] sending packet: from 185.**.**.**[4500] to 217.**.**.**[4500] (2552 bytes)
07[NET] received packet: from 217.**.**.**[4500] to 185.**.**.**[4500] (1816 bytes)
07[ENC] parsed IKE_AUTH response 1 [ V IDr CERT AUTH N(NO_PROP) ]
07[IKE] received end entity cert "OU=Domain Control Validated, CN=mercury.THEIR_ROUTER.com"
07[CFG] using certificate "OU=Domain Control Validated, CN=mercury.THEIR_ROUTER.com"
07[CFG] using trusted intermediate ca certificate "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., OU=http://certs.godaddy.com/repository/, CN=Go Daddy Secure Certificate Authority - G2"
07[CFG] checking certificate status of "OU=Domain Control Validated, CN=mercury.THEIR_ROUTER.com"
07[CFG] ocsp response correctly signed by "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy Inc., CN=Go Daddy Validation Authority - G2"
07[CFG] ocsp response is valid: until Sep 12 10:13:13 2018
07[CFG] using cached ocsp response
07[CFG] certificate status is good
07[CFG] using trusted ca certificate "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Certificate Authority - G2"
07[CFG] checking certificate status of "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., OU=http://certs.godaddy.com/repository/, CN=Go Daddy Secure Certificate Authority - G2"
07[CFG] ocsp response verification failed, no signer certificate 'C=US, ST=Arizona, L=Scottsdale, O=GoDaddy Inc., CN=Go Daddy Validation Authority - G2' found
07[CFG] ocsp response correctly signed by "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Validation Authority - G2"
07[CFG] ocsp response is valid: until Sep 12 19:18:44 2018
07[CFG] using cached ocsp response
07[CFG] certificate status is good
07[CFG] certificate policy 2.16.840.1.114413.1.7.23.1 for 'OU=Domain Control Validated, CN=mercury.THEIR_ROUTER.com' not allowed by trustchain, ignored
07[CFG] certificate policy 2.23.140.1.2.1 for 'OU=Domain Control Validated, CN=mercury.THEIR_ROUTER.com' not allowed by trustchain, ignored
07[CFG] reached self-signed root ca with a path length of 1
07[IKE] signature validation failed, looking for another key
07[CFG] using certificate "OU=Domain Control Validated, CN=mercury.THEIR_ROUTER.com"
07[CFG] using trusted intermediate ca certificate "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., OU=http://certs.godaddy.com/repository/, CN=Go Daddy Secure Certificate Authority - G2"
07[CFG] checking certificate status of "OU=Domain Control Validated, CN=mercury.THEIR_ROUTER.com"
07[CFG] ocsp response correctly signed by "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy Inc., CN=Go Daddy Validation Authority - G2"
07[CFG] ocsp response is valid: until Sep 12 10:13:13 2018
07[CFG] using cached ocsp response
07[CFG] certificate status is good
07[CFG] using trusted ca certificate "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Certificate Authority - G2"
07[CFG] checking certificate status of "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., OU=http://certs.godaddy.com/repository/, CN=Go Daddy Secure Certificate Authority - G2"
07[CFG] ocsp response verification failed, no signer certificate 'C=US, ST=Arizona, L=Scottsdale, O=GoDaddy Inc., CN=Go Daddy Validation Authority - G2' found
07[CFG] ocsp response correctly signed by "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Validation Authority - G2"
07[CFG] ocsp response is valid: until Sep 12 19:18:44 2018
07[CFG] using cached ocsp response
07[CFG] certificate status is good
07[CFG] certificate policy 2.16.840.1.114413.1.7.23.1 for 'OU=Domain Control Validated, CN=mercury.THEIR_ROUTER.com' not allowed by trustchain, ignored
07[CFG] certificate policy 2.23.140.1.2.1 for 'OU=Domain Control Validated, CN=mercury.THEIR_ROUTER.com' not allowed by trustchain, ignored
07[CFG] reached self-signed root ca with a path length of 1
07[IKE] signature validation failed, looking for another key
07[ENC] generating INFORMATIONAL request 2 [ N(AUTH_FAILED) ]
07[NET] sending packet: from 185.**.**.**[4500] to 217.**.**.**[4500] (88 bytes)
I've added the GoDaddy intermediate & Root certificates manually as needed (copied to /etc/ipsec.d/cacerts) and can verify they are loaded correctly :
root@ubnt:/home/admin# ipsec listcacerts
List of X.509 CA Certificates:
subject: "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., OU=http://certs.godaddy.com/repository/, CN=Go Daddy Secure Certificate Authority - G2"
issuer: "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Certificate Authority - G2"
serial: 07
validity: not before May 03 08:00:00 2011, ok
not after May 03 08:00:00 2031, ok
pubkey: RSA 2048 bits
keyid: b4:55:50:14:83:45:1f:ee:8c:a0:a1:0c:f5:af:de:3a:4c:5e:11:59
subjkey: 40:c2:bd:27:8e:cc:34:83:30:a2:33:d7:fb:6c:b3:f0:b4:2c:80:ce
authkey: 3a:9a:85:07:10:67:28:b6:ef:f6:bd:05:41:6e:20:c1:94:da:0f:de
subject: "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Certificate Authority - G2"
issuer: "C=US, ST=Arizona, L=Scottsdale, O=GoDaddy.com, Inc., CN=Go Daddy Root Certificate Authority - G2"
serial: 00
validity: not before Sep 01 01:00:00 2009, ok
not after Dec 31 23:59:59 2037, ok
pubkey: RSA 2048 bits
keyid: 21:0f:2c:89:f7:c4:cd:5d:1b:82:5e:38:d6:c6:59:3b:a6:93:75:ae
subjkey: 3a:9a:85:07:10:67:28:b6:ef:f6:bd:05:41:6e:20:c1:94:da:0f:de
subject: "C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Domain Validation Secure Server CA"
issuer: "C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Certification Authority"
serial: 2b:2e:6e:ea:d9:75:36:6c:14:8a:6e:db:a3:7c:8c:07
validity: not before Feb 12 00:00:00 2014, ok
not after Feb 11 23:59:59 2029, ok
pubkey: RSA 2048 bits
keyid: 49:7c:68:68:e4:84:cc:f0:ba:06:01:a6:c4:0b:7f:10:07:2c:6a:3c
subjkey: 90:af:6a:3a:94:5a:0b:d8:90:ea:12:56:73:df:43:b4:3a:28:da:e7
authkey: bb:af:7e:02:3d:fa:a6:f1:3c:84:8e:ad:ee:38:98:ec:d9:32:32:d4
pathlen: 0
Google is of little help identifying this problem so I'm somewhat stuck - it doesn't matter what I try (I've even tried manually editing the ipsec.conf to specify a ricghtca (it defaults to same) with no improvement.
If it helps, the remote side is a Cisco ASA which is not under my control and they have verified the certificate is in use with other clients for VPN with no issues.