File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/java/com/scality/keycloak/truststore Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -57,12 +57,13 @@ private CertificateRepresentation toCertificateRepresentation(TruststoreEntity e
5757 X509Certificate x509Certificate = toX509Certificate (entity .getCertificate ());
5858 try {
5959 X500Name x500name = new JcaX509CertificateHolder (x509Certificate ).getSubject ();
60- RDN cn = x500name .getRDNs (BCStyle .CN )[0 ];
60+ RDN [] rdns = x500name .getRDNs (BCStyle .CN );
61+ RDN cn = rdns .length > 0 ? rdns [0 ] : null ;
6162
6263 CertificateRepresentation certificate = new CertificateRepresentation (
6364 entity .getAlias (),
6465 entity .getCertificate (),
65- IETFUtils .valueToString (cn .getFirst ().getValue ()));
66+ cn != null ? IETFUtils .valueToString (cn .getFirst ().getValue ()) : "-" );
6667
6768 return certificate ;
6869
You can’t perform that action at this time.
0 commit comments