-
Bug
-
Resolution: Fixed
-
P4
-
11, 17, 23, 24, 25
-
b18
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Ubuntu 24.04.1 LTS
Oracle OpenJDK 23.0.2
A DESCRIPTION OF THE PROBLEM :
Enabling -Djava.security.debug=x509,ava affects how special characters in certificates are processed. The expected behavior is that debugging should not interfere with the normal encoding of certificate fields.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Step 0:
Generate a p12 file with a certificate with special characters
Step 1:
Compile provided source code
javac Main.java
Step 2:
Run class with
java -Djava.security.debug=x509,ava Main
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Display the special chars
ACTUAL -
No special chars displayed
---------- BEGIN SOURCE ----------
import java.security.cert.X509Certificate;
import java.io.FileInputStream;
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.util.Enumeration;
public class Main {
public static void main(String[] args) throws Exception {
String p12FilePath = "special_chars.p12";
String password = "password123";
KeyStore keyStore = KeyStore.getInstance("PKCS12");
// Load the KeyStore (PKCS12 format)
try(FileInputStream fis = new FileInputStream(p12FilePath)) {
keyStore.load(fis, password.toCharArray());
// Iterate through the aliases
Enumeration<String> aliases = keyStore.aliases();
while (aliases.hasMoreElements()) {
// Retrieve and print the certificate
Certificate cert = keyStore.getCertificate(aliases.nextElement());
X509Certificate x509Cert = (X509Certificate) cert;
System.out.println("Subject: " + x509Cert.getSubjectX500Principal().getName());
}
}
}
}
---------- END SOURCE ----------
Ubuntu 24.04.1 LTS
Oracle OpenJDK 23.0.2
A DESCRIPTION OF THE PROBLEM :
Enabling -Djava.security.debug=x509,ava affects how special characters in certificates are processed. The expected behavior is that debugging should not interfere with the normal encoding of certificate fields.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Step 0:
Generate a p12 file with a certificate with special characters
Step 1:
Compile provided source code
javac Main.java
Step 2:
Run class with
java -Djava.security.debug=x509,ava Main
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Display the special chars
ACTUAL -
No special chars displayed
---------- BEGIN SOURCE ----------
import java.security.cert.X509Certificate;
import java.io.FileInputStream;
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.util.Enumeration;
public class Main {
public static void main(String[] args) throws Exception {
String p12FilePath = "special_chars.p12";
String password = "password123";
KeyStore keyStore = KeyStore.getInstance("PKCS12");
// Load the KeyStore (PKCS12 format)
try(FileInputStream fis = new FileInputStream(p12FilePath)) {
keyStore.load(fis, password.toCharArray());
// Iterate through the aliases
Enumeration<String> aliases = keyStore.aliases();
while (aliases.hasMoreElements()) {
// Retrieve and print the certificate
Certificate cert = keyStore.getCertificate(aliases.nextElement());
X509Certificate x509Cert = (X509Certificate) cert;
System.out.println("Subject: " + x509Cert.getSubjectX500Principal().getName());
}
}
}
}
---------- END SOURCE ----------
- causes
-
JDK-8353945 Test javax/security/auth/x500/X500Principal/NameFormat.java fails after JDK-8349890
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/0d4d1558
-
Review(master) openjdk/jdk/24360