Where does "ipsec import" store certificate file?

317 Views Asked by At

I'm now setting up libreswan server - client. Basically, I'm trying to follow a procedure described here. https://kifarunix.com/setup-ipsec-vpn-server-with-libreswan-on-centos-8/

I created client certificate which is aaa.bbb.p12 from the server machine using pk12util command. And copied to client machine and import using ipsec import aaa.bbb.p12

ipsec import aaa.bbb.p12 was successful. But I don't know where this file stored when ipsec import command was executed. Is there any way I can browse this certificate file using a certain command?

1

There are 1 best solutions below

0
On

I found something but not perfect. I copied aaa.bbb.p12 and used ipsec command like below.

# ipsec import ./aaa.bbb.p12 --nssdir /etc/ipsec.d/certsdb

Then, I can see the certificate using the command below.

# certutil -L -d sql:/etc/ipsec.d/certsdb

But I still have one more problem. If I import one more certificate file such as aaa.ccc.p12.

Then, it is imported but it does not display certificate's name. Even though I imported aaa.bbb.p12 and aaa.ccc.p12 but the command below shows only aaa.bbb twice.

# certutil -L -d sql:/etc/ipsec.d/certsdb

Certificate Nickname                                         Trust Attributes
                                                             SSL,S/MIME,JAR/XPI

aaa.bbb                                                      u,u,u
aaa.bbb                                                      u,u,u