JDK-8187985 : Broken certificate number in debug output
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 10
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2017-09-27
  • Updated: 2018-05-14
  • Resolved: 2017-12-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 8
10 b35Fixed 8u172Fixed
Description
Reading the code of sun/security/tools/keytool/Main.java

-----------------
            int i = 0;
            for (Certificate cert : chain) {
                try {
                    if (rfc) {
                        dumpCert(cert, out);
                    } else {
                        out.println("Certificate #" + i++);
                        out.println("====================================");
                        printX509Cert((X509Certificate)cert, out);
                        out.println();
                    }
///// the following line can output "certificate 3 of 2" because oneInMany prints (i+1)
                    checkWeak(oneInMany(rb.getString("the.certificate"), i, chain.size()), cert);
-----------------