<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi Folks,</div><div><br></div><div>I am trying to establish an IKEv2/IPsec tunnel using certificate based authentication so that both ends can exchange certificates to authenticate themselves.</div><div><br></div><div>How can I configure Libreswan which initiates the connection to send a "certificate request" (CERTREQ) payload in IKE_AUTH request so that the other end can send it's certificate in the IKE_AUTH response back?</div><div><br></div><div>For example, I have configured as follows</div><div><br></div><div>conn radcert<br>        ikev2=yes<br>        left=10.196.175.174<br>        leftsubnet=<a href="http://10.196.175.174/32">10.196.175.174/32</a><br>        leftca=%same<br>        leftrsasigkey=%cert<br>        leftid=<a href="mailto:libswan@xyz.com">libswan@xyz.com</a>   <------ other end's identity<br>        leftprotoport=17/1812<br>        right=10.196.172.139<br>        rightsubnet=<a href="http://10.196.172.139/32">10.196.172.139/32</a><br>        rightprotoport=17/1812<br>        auto=ondemand<br>        ike=aes128-sha1;dh14<br>        phase2=esp<br>        phase2alg=aes128-sha1;modp2048<br>        pfs=yes<br>        rightcert="mycert"<br>        rightrsasigkey=%cert<br>        rightsendcert=always<br>        rightid=@<a href="http://abc.com">abc.com</a><br>        rightca=%same<br>        type=tunnel<br>        esn=no<br>        rekey=yes<br>        salifetime=28800s<br>        ikelifetime=3600s<br>        dpddelay=0s<br>        dpdtimeout=0s<br>        dpdaction=hold</div><div><br></div><div>I have p12 file in /etc/ipsec.d directory which is a container of mycert crtificate, mycert's CA certificate and private key of mycert. This p12 file is imported.</div><div><br></div><div>When this connection is activated, Libreswan sends its certificate (because rightsendcert=always) in CERT payload however it does not send CERTREQ payload. Is there a way to instruct Libreswan to send CERTREQ payload?</div><div><br></div><div>Jul 14 22:06:51 [localhost] pluto[6672]: "radcert" #1: initiating v2 parent SA                                                                     <br>Jul 14 22:06:51 [localhost] pluto[6672]: "radcert" #1: local IKE proposals for radcert (IKE SA initiator selecting KE): 1:IKE:ENCR=AES_CBC_128;PRF=HMAC_SHA1;INTEG=HMAC_SHA1_96;DH=MODP2048<br>Jul 14 22:06:51 [localhost] pluto[6672]: "radcert" #1: STATE_PARENT_I1: sent v2I1, expected v2R1                                              <br>Jul 14 22:06:51 [localhost] pluto[6672]: "radcert" #1: local ESP/AH proposals for radcert (IKE SA initiator emitting ESP/AH proposals): 1:ESP:ENCR=AES_CBC_128;INTEG=HMAC_SHA1_96;DH=NONE;ESN=DISABLED<br>Jul 14 22:06:51 [localhost] pluto[6672]: "radcert" #2: STATE_PARENT_I2: sent v2I2, expected v2R2 {auth=IKEv2 cipher=aes_128 integ=sha1_96 prf=sha group=MODP2048}<br>Jul 14 22:06:51 [localhost] pluto[6672]: "radcert" #2: IKEv2 mode peer ID is ID_USER_FQDN: '<a href="mailto:libswan@xyz.com">libswan@xyz.com</a>'          <br>Jul 14 22:06:51 [localhost] pluto[6672]: "radcert" #2: no RSA public key known for '<a href="mailto:libswan@xyz.com">libswan@xyz.com</a>'  <-----------------------------------                <br>Jul 14 22:06:51 [localhost] pluto[6672]: "radcert" #2: Digital Signature authentication failed                                       <br>Jul 14 22:06:51 [localhost] pluto[6672]: "radcert" #2: deleting state (STATE_PARENT_I2) and NOT sending notification   <br></div><div><br></div><div>Any help is greatly appreciated. Let me know if you need any other information.</div><div><br></div><div>Thanks,</div><div>Balaji</div></div></div></div>