-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
two generated certificates have the same serial number [Concurrency issue] #1279
Comments
It is difficult to validate your claim from a screenshot. Please share your certificates. You can share your certificates here on github or |
Thanks for trying to help. |
I updated the sample project to help you understand better the situation and the EasyRSA issue/bug. Project that show the situation: https://github.com/zappee/easyrsa-cert-issue/tree/master Please let me know if you need anything else. |
Thanks for your detailed analysis, it looks like you have isolated the problem. I could use your setup to develop a working locking mechanism but that will not be done for some time. I think you will need to accept that Easy-RSA is a simple tool and not designed for your use case. Which means you will need to ensure that you do not access the PKI multiple times, concurrently. If you want to hack a lock-file into |
Thanks for the response and the comments. Finally, I found an acceptable solution that ensures that EasyRSA runs only once at the same time and the other certificate-generating requests wait until it has finished.
Then I added this function call at the beginning of the script that generates my server certificates:
As far as I can see, only the `easyrsa gen-req' command has a problem with parallel execution. That would be great if you could add this check somehow to the tool as a new feature in the future. Thanks for helping me and for this nice EasyRSA tool. log:
|
For your own clarity, it is command |
@zappee btw, nice example! 👍 Edit: Re-opened, OpenSSL warn of this concurrency issue. |
I use EasyRSA in my Docker environment to generate certificates for my containers that are signed by my root CA. Recently a strange thing happened and I have no idea why and how to fix it.
Inside the Docker containers I run applications with web servers (Spring Boot/Tomcat). Behind the web servers I use certificates issued by EasyRSA. Today, when I tried to open web content from different containers, the web browser complained about
SEC_ERROR_REUSED_ISSUER_AND_SERIAL
.URLs that I opened:
https://localhost:14114/api/user/1
https://localhost:14124/api/user/1
As I see it, the problem is that the two certificates generated have the same serial number. I used the same EasyRSA environment to issue the certificates. The issued certificates have different serial numbers except for these two:
user-service-1
anduser-service-2
:[link to the screenshot](https://drive.google.com/file/d/1fm9u6kpzhCSYbkzABRJ2QSOLeXMpAefW/view?usp=sharing
I use the following commands to generate certs:
where:
EasyRSA version:
The creation date of the two certs with the same serial number:
$ pwd
/opt/easy-rsa/pki/issued
$ ll
-rw------- 1 root root 2902 Jan 4 22:52 echo-service-1.hello.com.crt
-rw------- 1 root root 2824 Jan 4 22:52 pki.hello.com.crt
-rw------- 1 root root 2892 Jan 4 22:52 user-service-1.hello.com.crt
-rw------- 1 root root 2895 Jan 4 22:52 user-service-2.hello.com.crt
file dates:
Why the two generated certs have the same serial number and how to avoid this situation?
Is this a bug?
The text was updated successfully, but these errors were encountered: