I am trying to test with IPSec Roadwarrior and I have seen the limitation with Presared Key since it only allows one connection. So, I said to myself, let’s try certificates. Now comes the problem.
When I try to generate a “Generate root/host certificate” it gives me the following error:
I just tried it on my vm testbed with CU174 and it worked fine without any problems.
Looking up the error code on the internet a common theme seems to be that you are trying to use a Name that is already being used in a certificate somewhere in your IPFire system.
That is not allowed as the name=unique_subject means that the name has to be unique and cannot already be used.
There might be more details in the logs
grep charon /var/log/messages will extract the logs related to IPSec.
Alternatively run
tail-f /var/log/messaged | grep charon
This will show the log file as it is created so you can press the Generate Root/Host Certificates and look at the terminal window and see what messages come up when the openssl error occurs. The log might give more details about which part of the x509 generation is failing.
EDIT:
Found that the Subject is made up of the Organisation, Organisation Unit, Common Name etc in a string.
This Subject has to be unique. That means that you have used the same Organisation Name, Organisation Unit, Common Name, Country etc in another certificate somewhere.
I tried it with Core Update 175 Development Build master/9797af30 and had the same error message.
There is an openssl issue with OpenVPN when accessing .p12 files and I had seen that IPSec also used openssl commands on .p12 files.
I added in the legacy option to all the openssl commands working on pkcs (.p12) files but found that this did not fix the problem.
I then added the legacy option to every openssl command in the IPSec vpnmain.cgi code. This resulted in the Root/Host certificate being successfully created.
There looks to be a difference between openssl-1.1.1x and openssl-3.x in terms of other openssl commands beyond the ones dealing with .p12 files.
The fix mentioned here will be supplied as a patch submission together with the one I have been working on for the OpenVPN openssl command issues.
I have tried that and confirm it works. What I am not sure about is why it works.
I looked unique_subject up and it seemed to say that the default was yes anyway. Also could not find anything related to openssl-3 causing this to be needed.
How did you identify that this would help?
I now have this option and the one of adding the legacy option into every openssl command and I don’t know how to make the decision.
Anything to help in making this decision would be appreciated.
Unfortunately I missed yesterday that using the -legacy option in every openssl command resulted in the Root certificate being shown but not the Host certificate. So more work needed before a patch can be submitted.
Figured out what needed to be done and patch submitted.