File tree Expand file tree Collapse file tree
src/java/com/wolfssl/provider/jsse Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -673,12 +673,11 @@ public Certificate[] getLocalCertificates() {
673673 public synchronized Principal getPeerPrincipal ()
674674 throws SSLPeerUnverifiedException {
675675
676- /* Use standard Java X509Certificate.getSubjectDN()
677- * for X500Name equals() compatibility */
676+ /* Return X500Principal for proper equals() symmetry */
678677 Certificate [] certs = getPeerCertificates ();
679678 if (certs != null && certs .length > 0 &&
680679 certs [0 ] instanceof X509Certificate ) {
681- return ((X509Certificate ) certs [0 ]).getSubjectDN ();
680+ return ((X509Certificate ) certs [0 ]).getSubjectX500Principal ();
682681 }
683682 throw new SSLPeerUnverifiedException ("No peer certificate" );
684683 }
@@ -699,7 +698,7 @@ public Principal getLocalPrincipal() {
699698 if (certs .length > 0 ){
700699 /* When chain of certificates exceeds one,
701700 * the user certifcate is the first */
702- localPrincipal = certs [0 ].getSubjectDN ();
701+ localPrincipal = certs [0 ].getSubjectX500Principal ();
703702 }
704703
705704 /* free native resources earlier than garbage collection if
You can’t perform that action at this time.
0 commit comments