/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* HTTPS URL connection support.
* We need this delegate because HttpsURLConnection is a subclass of
* java.net.HttpURLConnection. We will avoid copying over the code from
* sun.net.www.protocol.http.HttpURLConnection by having this class
*
*/
public abstract class AbstractDelegateHttpsURLConnection extends
}
}
/**
* No user application is able to call these routines, as no one
* should ever get access to an instance of
* DelegateHttpsURLConnection (sun.* or com.*)
*/
/**
* Create a new HttpClient object, bypassing the cache of
* HTTP client objects/connections.
*
* Note: this method is changed from protected to public because
* the com.sun.ssl.internal.www.protocol.https handler reuses this
* class for its actual implemantation
*
* @param url the URL being accessed
*/
throws IOException {
setNewClient (url, false);
}
/**
* Obtain a HttpClient object. Use the cached copy if specified.
*
* Note: this method is changed from protected to public because
* the com.sun.ssl.internal.www.protocol.https handler reuses this
* class for its actual implemantation
*
* @param url the URL being accessed
* @param useCache whether the cached connection should be used
* if present
*/
throws IOException {
url,
useCache, this);
}
/**
* Create a new HttpClient object, set up so that it uses
* per-instance proxying to the given HTTP proxy. This
* bypasses the cache of HTTP client objects/connections.
*
* Note: this method is changed from protected to public because
* the com.sun.ssl.internal.www.protocol.https handler reuses this
* class for its actual implemantation
*
* @param url the URL being accessed
* @param proxyHost the proxy host to use
* @param proxyPort the proxy port to use
*/
throws IOException {
}
/**
* Obtain a HttpClient object, set up so that it uses per-instance
* proxying to the given HTTP proxy. Use the cached copy of HTTP
* client objects/connections if specified.
*
* Note: this method is changed from protected to public because
* the com.sun.ssl.internal.www.protocol.https handler reuses this
* class for its actual implemantation
*
* @param url the URL being accessed
* @param proxyHost the proxy host to use
* @param proxyPort the proxy port to use
* @param useCache whether the cached connection should be used
* if present
*/
boolean useCache) throws IOException {
if (!http.isCachedConnection()) {
doTunneling();
}
}
boolean useCache) throws IOException {
if (connected)
return;
url,
connected = true;
}
/**
* Used by subclass to access "connected" variable.
*/
public boolean isConnected() {
return connected;
}
/**
* Used by subclass to access "connected" variable.
*/
}
/**
* Implements the HTTP protocol handler's "connect" method,
* establishing an SSL connection to the server as necessary.
*/
if (connected)
return;
plainConnect();
if (cachedResponse != null) {
// using cached response
return;
}
doTunneling();
}
}
// will try to use cached HttpsClient
throws IOException {
getHostnameVerifier(), p, true, connectTimeout,
this);
}
// will open new connection
boolean useCache)
throws IOException {
getHostnameVerifier(), p,
useCache, connectTimeout, this);
}
/**
* Returns the cipher suite in use on this connection.
*/
if (cachedResponse != null) {
}
throw new IllegalStateException("connection not yet open");
} else {
}
}
/**
* Returns the certificate chain the client sent to the
* server, or null if the client did not authenticate.
*/
if (cachedResponse != null) {
if (l == null) {
return null;
} else {
}
}
throw new IllegalStateException("connection not yet open");
} else {
}
}
/**
* Returns the server's certificate chain, or throws
* SSLPeerUnverified Exception if
* the server did not authenticate.
*/
throws SSLPeerUnverifiedException {
if (cachedResponse != null) {
if (l == null) {
return null;
} else {
}
}
throw new IllegalStateException("connection not yet open");
} else {
}
}
/**
* Returns the server's X.509 certificate chain, or null if
* the server did not authenticate.
*/
throws SSLPeerUnverifiedException {
if (cachedResponse != null) {
throw new UnsupportedOperationException("this method is not supported when using cache");
}
throw new IllegalStateException("connection not yet open");
} else {
}
}
/**
* Returns the server's principal, or throws SSLPeerUnverifiedException
* if the server did not authenticate.
*/
throws SSLPeerUnverifiedException
{
if (cachedResponse != null) {
}
throw new IllegalStateException("connection not yet open");
} else {
}
}
/**
* Returns the principal the client sent to the
* server, or null if the client did not authenticate.
*/
{
if (cachedResponse != null) {
}
throw new IllegalStateException("connection not yet open");
} else {
}
}
}