/testing/guestbin/swan-prep
west #
 rm -f /etc/ipsec.d/*.*
west #
 ipsec initnss > /dev/null 2> /dev/null
west #
 pk12util -i OUTPUT/nss/client.p12 -d sql:/etc/ipsec.d -K 'foobar' -W 'foobar'
pk12util: PKCS12 IMPORT SUCCESSFUL
west #
 certutil -M -d sql:/etc/ipsec.d -n cacert -t 'CT,,'
west #
 ipsec start
Redirecting to: [initsystem]
west #
 ../../guestbin/wait-until-pluto-started
west #
 ipsec auto --add x509
002 "x509": added IKEv2 connection
west #
 ipsec auto --add x509-comma-comma
002 "x509-comma-comma": added IKEv2 connection
west #
 # show both conns are interpreted with \,
west #
 ipsec status |grep idtype
000 "x509":   our idtype: ID_DER_ASN1_DN; our id=CN=client, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ; their idtype: ID_DER_ASN1_DN; their id=CN=server, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ
000 "x509-comma-comma":   our idtype: ID_DER_ASN1_DN; our id=CN=client, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ; their idtype: ID_DER_ASN1_DN; their id=CN=server, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ
west #
 echo "initdone"
initdone
west #
 ipsec status |grep OU=
000 "x509": 192.0.1.0/24===192.1.2.45[CN=client, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ]...192.1.2.23[CN=server, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ]===192.0.2.0/24; unrouted; eroute owner: #0
000 "x509":   our idtype: ID_DER_ASN1_DN; our id=CN=client, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ; their idtype: ID_DER_ASN1_DN; their id=CN=server, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ
000 "x509-comma-comma": 192.0.1.0/24===192.1.2.45[CN=client, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ]...192.1.2.23[CN=server, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ]===192.0.2.0/24; unrouted; eroute owner: #0
000 "x509-comma-comma":   our idtype: ID_DER_ASN1_DN; our id=CN=client, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ; their idtype: ID_DER_ASN1_DN; their id=CN=server, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ
west #
 ipsec auto --listall |grep OU=
000        ID_DER_ASN1_DN 'CN=client, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ'
000   subject: CN=client, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ
west #
 ipsec auto --up x509
1v2 "x509" #1: initiating IKEv2 connection
1v2 "x509" #1: sent IKE_SA_INIT request
1v2 "x509" #1: sent IKE_AUTH request {cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=MODP2048}
003 "x509" #1: established IKE SA; authenticated using RSA with SHA2_512 and peer certificate 'CN=server, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ' issued by CA 'CN=cacert'
004 "x509" #2: established Child SA using #1; IPsec tunnel [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0] {ESP/ESN=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE DPD=passive}
west #
 echo "done"
done
west #
 
