harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r993080 - /harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
Date Mon, 06 Sep 2010 16:09:03 GMT
Author: odeakin
Date: Mon Sep  6 16:09:03 2010
New Revision: 993080

URL: http://svn.apache.org/viewvc?rev=993080&view=rev
Log:
Only get peer certs when SSL is not null.

Modified:
    harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java

Modified: harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java?rev=993080&r1=993079&r2=993080&view=diff
==============================================================================
--- harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
(original)
+++ harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
Mon Sep  6 16:09:03 2010
@@ -228,30 +228,30 @@ public class SSLSessionImpl implements S
                 peerPort = socket.getPort();
                 peerHost = socket.getInetAddress().getHostName();
             }
-        }
 
-        lastAccessedTime = creationTime;
-        localCertificates = parms.getCertificateChain();
-
-        // Get the list of DER encoded peer certificates from OpenSSL
-        Object[] DERCerts = getPeerCertificatesImpl(SSL);
-        if (DERCerts != null) {
-            // If we have got an array of DER certificates, generate X509Certificates from
them
-            CertificateFactory cf;
-            try {
-                cf = CertificateFactory.getInstance("X.509");
-            } catch (CertificateException e) {
-                throw new Error(e);
-            }
-            peerCertificates = new X509Certificate[DERCerts.length];
-            for (int i=0; i<peerCertificates.length; i++) {
+            // Get the list of DER encoded peer certificates from OpenSSL
+            Object[] DERCerts = getPeerCertificatesImpl(SSL);
+            if (DERCerts != null) {
+                // If we have got an array of DER certificates, generate X509Certificates
from them
+                CertificateFactory cf;
                 try {
-                    peerCertificates[i] = (X509Certificate)cf.generateCertificate(new ByteArrayInputStream((byte[])DERCerts[i]));
+                    cf = CertificateFactory.getInstance("X.509");
                 } catch (CertificateException e) {
-                    // Do nothing
+                    throw new Error(e);
+                }
+                peerCertificates = new X509Certificate[DERCerts.length];
+                for (int i=0; i<peerCertificates.length; i++) {
+                    try {
+                        peerCertificates[i] = (X509Certificate)cf.generateCertificate(new
ByteArrayInputStream((byte[])DERCerts[i]));
+                    } catch (CertificateException e) {
+                        // Do nothing
+                    }
                 }
             }
         }
+
+        lastAccessedTime = creationTime;
+        localCertificates = parms.getCertificateChain();
     }
 
     public int getApplicationBufferSize() {



Mime
View raw message