/testing/guestbin/swan-prep
west #
 rm -f /etc/ipsec.d/*.*
west #
 ipsec initnss > /dev/null 2> /dev/null
west #
 pk12util -i /testing/x509/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 #
 /testing/pluto/bin/wait-until-pluto-started
west #
 ipsec auto --add x509
002 added IKEv2 connection "x509"
west #
 ipsec auto --add x509-comma-comma
002 added IKEv2 connection "x509-comma-comma"
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<192.1.2.45>[CN=client, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ]...192.1.2.23<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<192.1.2.45>[CN=client, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ]...192.1.2.23<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 {auth=IKEv2 cipher=AES_GCM_16_256 integ=n/a prf=HMAC_SHA2_512 group=MODP2048}
002 "x509" #1: certificate verified OK: C=CZ,ST=Moravia,L=Brno,O=Test Example,OU="Global, Support, Services",CN=server
002 "x509" #2: IKEv2 mode peer ID is ID_DER_ASN1_DN: 'CN=server, OU=Global\, Support\, Services, O=Test Example, L=Brno, ST=Moravia, C=CZ'
003 "x509" #1: authenticated using RSA with SHA2_512
002 "x509" #2: negotiated connection [192.0.1.0-192.0.1.255:0-65535 0] -> [192.0.2.0-192.0.2.255:0-65535 0]
004 "x509" #2: IPsec SA established tunnel mode {ESP=>0xESPESP <0xESPESP xfrm=AES_GCM_16_256-NONE NATOA=none NATD=none DPD=passive}
west #
 echo "done"
done
west #
 
