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,12 @@ 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 ])
681+ .getSubjectX500Principal ();
682682 }
683683 throw new SSLPeerUnverifiedException ("No peer certificate" );
684684 }
@@ -699,7 +699,7 @@ public Principal getLocalPrincipal() {
699699 if (certs .length > 0 ){
700700 /* When chain of certificates exceeds one,
701701 * the user certifcate is the first */
702- localPrincipal = certs [0 ].getSubjectDN ();
702+ localPrincipal = certs [0 ].getSubjectX500Principal ();
703703 }
704704
705705 /* free native resources earlier than garbage collection if
You can’t perform that action at this time.
0 commit comments