Error generating Ca in OpenSSL: TXT_ DB error number 2


Sign the certificate?[y/n]:y

failed to update database

TXT_DB error number 2

occurs because

This thing happens when certificates share common data. You cannot have two
certificates that look the same.

method 1 :

modify demoCA under index.txt.attr

Java code

  1. unique_subject = yes


    Java code

    1. unique_subject = no

      method 2 :

      delete demoCA under the index. TXT, and then touch

      Java code

      1. rm index. TXT
      2. touch index. TXT

        method three :

        sets the common name to a different

        the second method I use when I encounter such situations;


Read More: