Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 32422 invoked from network); 14 Dec 2008 05:57:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Dec 2008 05:57:51 -0000 Received: (qmail 22848 invoked by uid 500); 14 Dec 2008 05:58:04 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 22825 invoked by uid 500); 14 Dec 2008 05:58:04 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 22816 invoked by uid 99); 14 Dec 2008 05:58:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Dec 2008 21:58:04 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Dec 2008 05:57:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 825302388970; Sat, 13 Dec 2008 21:57:30 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r726378 - /harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/HttpsURLConnection.java Date: Sun, 14 Dec 2008 05:57:30 -0000 To: commits@harmony.apache.org From: ndbeyer@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081214055730.825302388970@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ndbeyer Date: Sat Dec 13 21:57:29 2008 New Revision: 726378 URL: http://svn.apache.org/viewvc?rev=726378&view=rev Log: Make sslSocketFactory an instance field, per spec, rearrange static methods to top of class. Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/HttpsURLConnection.java Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/HttpsURLConnection.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/HttpsURLConnection.java?rev=726378&r1=726377&r2=726378&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/HttpsURLConnection.java (original) +++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/javax/net/ssl/HttpsURLConnection.java Sat Dec 13 21:57:29 2008 @@ -28,10 +28,6 @@ import java.security.cert.Certificate; import java.security.cert.X509Certificate; -/** - * @com.intel.drl.spec_ref - * - */ public abstract class HttpsURLConnection extends HttpURLConnection { private static HostnameVerifier defaultHostnameVerifier = new DefaultHostnameVerifier(); @@ -39,53 +35,60 @@ private static SSLSocketFactory defaultSSLSocketFactory = (SSLSocketFactory) SSLSocketFactory .getDefault(); + public static void setDefaultHostnameVerifier(HostnameVerifier v) { + if (v == null) { + throw new IllegalArgumentException("HostnameVerifier is null"); + } + defaultHostnameVerifier = v; + } + + public static HostnameVerifier getDefaultHostnameVerifier() { + return defaultHostnameVerifier; + } + + public static void setDefaultSSLSocketFactory(SSLSocketFactory sf) { + if (sf == null) { + throw new IllegalArgumentException("SSLSocketFactory is null"); + } + defaultSSLSocketFactory = sf; + } + + public static SSLSocketFactory getDefaultSSLSocketFactory() { + return defaultSSLSocketFactory; + } + protected HostnameVerifier hostnameVerifier; - private static SSLSocketFactory socketFactory; + private SSLSocketFactory sslSocketFactory; protected HttpsURLConnection(URL url) { super(url); hostnameVerifier = defaultHostnameVerifier; - socketFactory = defaultSSLSocketFactory; + sslSocketFactory = defaultSSLSocketFactory; } public abstract String getCipherSuite(); public abstract Certificate[] getLocalCertificates(); - public abstract Certificate[] getServerCertificates() - throws SSLPeerUnverifiedException; + public abstract Certificate[] getServerCertificates() throws SSLPeerUnverifiedException; public Principal getPeerPrincipal() throws SSLPeerUnverifiedException { Certificate[] certs = getServerCertificates(); - if (certs == null || certs.length == 0 || - (!(certs[0] instanceof X509Certificate))) { - throw new SSLPeerUnverifiedException( - "No server's end-entity certificate"); + if (certs == null || certs.length == 0 || (!(certs[0] instanceof X509Certificate))) { + throw new SSLPeerUnverifiedException("No server's end-entity certificate"); } return ((X509Certificate) certs[0]).getSubjectX500Principal(); } public Principal getLocalPrincipal() { Certificate[] certs = getLocalCertificates(); - if (certs == null || certs.length == 0 - || (!(certs[0] instanceof X509Certificate))) { + if (certs == null || certs.length == 0 || (!(certs[0] instanceof X509Certificate))) { return null; } return ((X509Certificate) certs[0]).getSubjectX500Principal(); } - public static void setDefaultHostnameVerifier(HostnameVerifier v) { - if (v == null) { - throw new IllegalArgumentException("HostnameVerifier is null"); - } - defaultHostnameVerifier = v; - } - - public static HostnameVerifier getDefaultHostnameVerifier() { - return defaultHostnameVerifier; - } - public void setHostnameVerifier(HostnameVerifier v) { if (v == null) { throw new IllegalArgumentException("HostnameVerifier is null"); @@ -97,26 +100,15 @@ return hostnameVerifier; } - public static void setDefaultSSLSocketFactory(SSLSocketFactory sf) { - if (sf == null) { - throw new IllegalArgumentException("SSLSocketFactory is null"); - } - defaultSSLSocketFactory = sf; - } - - public static SSLSocketFactory getDefaultSSLSocketFactory() { - return defaultSSLSocketFactory; - } - public void setSSLSocketFactory(SSLSocketFactory sf) { if (sf == null) { throw new IllegalArgumentException("SSLSocketFactory is null"); } - socketFactory = sf; + sslSocketFactory = sf; } public SSLSocketFactory getSSLSocketFactory() { - return socketFactory; + return sslSocketFactory; } -} \ No newline at end of file +}