directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1778641 - /directory/apacheds/branches/apacheds-value/server-integ/src/test/java/org/apache/directory/server/ssl/BogusTrustManagerFactory.java
Date Fri, 13 Jan 2017 17:55:09 GMT
Author: elecharny
Date: Fri Jan 13 17:55:09 2017
New Revision: 1778641

URL: http://svn.apache.org/viewvc?rev=1778641&view=rev
Log:
Fixed the TrustManagerFactory class

Modified:
    directory/apacheds/branches/apacheds-value/server-integ/src/test/java/org/apache/directory/server/ssl/BogusTrustManagerFactory.java

Modified: directory/apacheds/branches/apacheds-value/server-integ/src/test/java/org/apache/directory/server/ssl/BogusTrustManagerFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-value/server-integ/src/test/java/org/apache/directory/server/ssl/BogusTrustManagerFactory.java?rev=1778641&r1=1778640&r2=1778641&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-value/server-integ/src/test/java/org/apache/directory/server/ssl/BogusTrustManagerFactory.java
(original)
+++ directory/apacheds/branches/apacheds-value/server-integ/src/test/java/org/apache/directory/server/ssl/BogusTrustManagerFactory.java
Fri Jan 13 17:55:09 2017
@@ -20,6 +20,7 @@
 package org.apache.directory.server.ssl;
 
 
+import java.net.Socket;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
@@ -27,8 +28,10 @@ import java.security.cert.CertificateExc
 import java.security.cert.X509Certificate;
 
 import javax.net.ssl.ManagerFactoryParameters;
+import javax.net.ssl.SSLEngine;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.TrustManagerFactorySpi;
+import javax.net.ssl.X509ExtendedTrustManager;
 import javax.net.ssl.X509TrustManager;
 
 
@@ -45,22 +48,45 @@ class BogusTrustManagerFactory extends T
      */
     static X509Certificate[] lastReceivedServerCertificates;
 
-    static final X509TrustManager X509 = new X509TrustManager()
-    {
-        public void checkClientTrusted( X509Certificate[] x509Certificates, String s ) throws
CertificateException
-        {
+    static final X509TrustManager X509 = new X509ExtendedTrustManager() {
+
+        @Override
+        public void checkClientTrusted( X509Certificate[] chain, String authType ) throws
CertificateException {
+            lastReceivedServerCertificates = chain;
         }
 
+        @Override
+        public void checkServerTrusted( X509Certificate[] chain, String authType ) throws
CertificateException {
+            lastReceivedServerCertificates = chain;
+        }
 
-        public void checkServerTrusted( X509Certificate[] x509Certificates, String s ) throws
CertificateException
-        {
-            lastReceivedServerCertificates = x509Certificates;
+        @Override
+        public X509Certificate[] getAcceptedIssuers() {
+            return new X509Certificate[0];
         }
 
+        @Override
+        public void checkClientTrusted( X509Certificate[] chain, String authType, Socket
socket )
+            throws CertificateException {
+            lastReceivedServerCertificates = chain;
+        }
 
-        public X509Certificate[] getAcceptedIssuers()
-        {
-            return new X509Certificate[0];
+        @Override
+        public void checkClientTrusted( X509Certificate[] chain, String authType, SSLEngine
engine )
+            throws CertificateException {
+            lastReceivedServerCertificates = chain;
+        }
+
+        @Override
+        public void checkServerTrusted( X509Certificate[] chain, String authType, Socket
socket )
+            throws CertificateException {
+            lastReceivedServerCertificates = chain;
+        }
+
+        @Override
+        public void checkServerTrusted( X509Certificate[] chain, String authType, SSLEngine
engine )
+            throws CertificateException {
+            lastReceivedServerCertificates = chain;
         }
     };
 



Mime
View raw message