Java Doc for HttpsURLConnection.java in  » 6.0-JDK-Core » net » javax » net » ssl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » net » javax.net.ssl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.net.HttpURLConnection
   javax.net.ssl.HttpsURLConnection

HttpsURLConnection
abstract public class HttpsURLConnection extends HttpURLConnection (Code)
HttpsURLConnection extends HttpURLConnection with support for https-specific features.

See http://www.w3.org/pub/WWW/Protocols/ and RFC 2818 for more details on the https specification.

This class uses HostnameVerifier and SSLSocketFactory. There are default implementations defined for both classes. However, the implementations can be replaced on a per-class (static) or per-instance basis. All new HttpsURLConnections instances will be assigned the "default" static values at instance creation, but they can be overriden by calling the appropriate per-instance set method(s) before connecting.
since:
   1.4
version:
   1.33



Field Summary
protected  HostnameVerifierhostnameVerifier
     The hostnameVerifier for this object.

Constructor Summary
protected  HttpsURLConnection(URL url)
     Creates an HttpsURLConnection using the URL specified.

Method Summary
abstract public  StringgetCipherSuite()
     Returns the cipher suite in use on this connection.
public static  HostnameVerifiergetDefaultHostnameVerifier()
     Gets the default HostnameVerifier that is inherited by new instances of this class.
public static  SSLSocketFactorygetDefaultSSLSocketFactory()
     Gets the default static SSLSocketFactory that is inherited by new instances of this class.
public  HostnameVerifiergetHostnameVerifier()
     Gets the HostnameVerifier in place on this instance.
abstract public  java.security.cert.Certificate[]getLocalCertificates()
     Returns the certificate(s) that were sent to the server during handshaking.

Note: This method is useful only when using certificate-based cipher suites.

When multiple certificates are available for use in a handshake, the implementation chooses what it considers the "best" certificate chain available, and transmits that to the other side.

public  PrincipalgetLocalPrincipal()
     Returns the principal that was sent to the server during handshaking.

Note: Subclasses should override this method.

public  PrincipalgetPeerPrincipal()
     Returns the server's principal which was established as part of defining the session.

Note: Subclasses should override this method.

public  SSLSocketFactorygetSSLSocketFactory()
     Gets the SSL socket factory to be used when creating sockets for secure https URL connections.
abstract public  java.security.cert.Certificate[]getServerCertificates()
     Returns the server's certificate chain which was established as part of defining the session.
public static  voidsetDefaultHostnameVerifier(HostnameVerifier v)
     Sets the default HostnameVerifier inherited by a new instance of this class.
public static  voidsetDefaultSSLSocketFactory(SSLSocketFactory sf)
     Sets the default SSLSocketFactory inherited by new instances of this class.
public  voidsetHostnameVerifier(HostnameVerifier v)
     Sets the HostnameVerifier for this instance.

New instances of this class inherit the default static hostname verifier set by HttpsURLConnection.setDefaultHostnameVerifier(HostnameVerifier)setDefaultHostnameVerifier .

public  voidsetSSLSocketFactory(SSLSocketFactory sf)
     Sets the SSLSocketFactory to be used when this instance creates sockets for secure https URL connections.

New instances of this class inherit the default static SSLSocketFactory set by HttpsURLConnection.setDefaultSSLSocketFactory(SSLSocketFactory)setDefaultSSLSocketFactory .


Field Detail
hostnameVerifier
protected HostnameVerifier hostnameVerifier(Code)
The hostnameVerifier for this object.




Constructor Detail
HttpsURLConnection
protected HttpsURLConnection(URL url)(Code)
Creates an HttpsURLConnection using the URL specified.
Parameters:
  url - the URL




Method Detail
getCipherSuite
abstract public String getCipherSuite()(Code)
Returns the cipher suite in use on this connection. the cipher suite
throws:
  IllegalStateException - if this method is called beforethe connection has been established.



getDefaultHostnameVerifier
public static HostnameVerifier getDefaultHostnameVerifier()(Code)
Gets the default HostnameVerifier that is inherited by new instances of this class. the default host name verifier
See Also:   HttpsURLConnection.setDefaultHostnameVerifier(HostnameVerifier)



getDefaultSSLSocketFactory
public static SSLSocketFactory getDefaultSSLSocketFactory()(Code)
Gets the default static SSLSocketFactory that is inherited by new instances of this class.

The socket factories are used when creating sockets for secure https URL connections. the default SSLSocketFactory
See Also:   HttpsURLConnection.setDefaultSSLSocketFactory(SSLSocketFactory)




getHostnameVerifier
public HostnameVerifier getHostnameVerifier()(Code)
Gets the HostnameVerifier in place on this instance. the host name verifier
See Also:   HttpsURLConnection.setHostnameVerifier(HostnameVerifier)
See Also:   HttpsURLConnection.setDefaultHostnameVerifier(HostnameVerifier)



getLocalCertificates
abstract public java.security.cert.Certificate[] getLocalCertificates()(Code)
Returns the certificate(s) that were sent to the server during handshaking.

Note: This method is useful only when using certificate-based cipher suites.

When multiple certificates are available for use in a handshake, the implementation chooses what it considers the "best" certificate chain available, and transmits that to the other side. This method allows the caller to know which certificate chain was actually sent. an ordered array of certificates,with the client's own certificate first followed by anycertificate authorities. If no certificates were sent,then null is returned.
throws:
  IllegalStateException - if this method is called beforethe connection has been established.
See Also:   HttpsURLConnection.getLocalPrincipal()




getLocalPrincipal
public Principal getLocalPrincipal()(Code)
Returns the principal that was sent to the server during handshaking.

Note: Subclasses should override this method. If not overridden, it will default to returning the X500Principal of the end-entity certificate that was sent to the server for certificate-based ciphersuites or, return null for non-certificate based ciphersuites, such as Kerberos. the principal sent to the server. Returns an X500Principalof the end-entity certificate for X509-based cipher suites, andKerberosPrincipal for Kerberos cipher suites. If no principal wassent, then null is returned.
throws:
  IllegalStateException - if this method is called beforethe connection has been established.
See Also:   HttpsURLConnection.getLocalCertificates()
See Also:   HttpsURLConnection.getPeerPrincipal()
since:
   1.5




getPeerPrincipal
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException(Code)
Returns the server's principal which was established as part of defining the session.

Note: Subclasses should override this method. If not overridden, it will default to returning the X500Principal of the server's end-entity certificate for certificate-based ciphersuites, or throw an SSLPeerUnverifiedException for non-certificate based ciphersuites, such as Kerberos. the server's principal. Returns an X500Principal of theend-entity certiticate for X509-based cipher suites, andKerberosPrincipal for Kerberos cipher suites.
throws:
  SSLPeerUnverifiedException - if the peer was not verified
throws:
  IllegalStateException - if this method is called beforethe connection has been established.
See Also:   HttpsURLConnection.getServerCertificates()
See Also:   HttpsURLConnection.getLocalPrincipal()
since:
   1.5




getSSLSocketFactory
public SSLSocketFactory getSSLSocketFactory()(Code)
Gets the SSL socket factory to be used when creating sockets for secure https URL connections. the SSLSocketFactory
See Also:   HttpsURLConnection.setSSLSocketFactory(SSLSocketFactory)



getServerCertificates
abstract public java.security.cert.Certificate[] getServerCertificates() throws SSLPeerUnverifiedException(Code)
Returns the server's certificate chain which was established as part of defining the session.

Note: This method can be used only when using certificate-based cipher suites; using it with non-certificate-based cipher suites, such as Kerberos, will throw an SSLPeerUnverifiedException. an ordered array of server certificates,with the peer's own certificate first followed byany certificate authorities.
throws:
  SSLPeerUnverifiedException - if the peer is not verified.
throws:
  IllegalStateException - if this method is called beforethe connection has been established.
See Also:   HttpsURLConnection.getPeerPrincipal()




setDefaultHostnameVerifier
public static void setDefaultHostnameVerifier(HostnameVerifier v)(Code)
Sets the default HostnameVerifier inherited by a new instance of this class.

If this method is not called, the default HostnameVerifier assumes the connection should not be permitted.
Parameters:
  v - the default host name verifier
throws:
  IllegalArgumentException - if the HostnameVerifierparameter is null.
throws:
  SecurityException - if a security manager exists and itscheckPermission method does not allowSSLPermission("setHostnameVerifier")
See Also:   HttpsURLConnection.getDefaultHostnameVerifier()




setDefaultSSLSocketFactory
public static void setDefaultSSLSocketFactory(SSLSocketFactory sf)(Code)
Sets the default SSLSocketFactory inherited by new instances of this class.

The socket factories are used when creating sockets for secure https URL connections.
Parameters:
  sf - the default SSL socket factory
throws:
  IllegalArgumentException - if the SSLSocketFactoryparameter is null.
throws:
  SecurityException - if a security manager exists and itscheckSetFactory method does not allowa socket factory to be specified.
See Also:   HttpsURLConnection.getDefaultSSLSocketFactory()




setHostnameVerifier
public void setHostnameVerifier(HostnameVerifier v)(Code)
Sets the HostnameVerifier for this instance.

New instances of this class inherit the default static hostname verifier set by HttpsURLConnection.setDefaultHostnameVerifier(HostnameVerifier)setDefaultHostnameVerifier . Calls to this method replace this object's HostnameVerifier.
Parameters:
  v - the host name verifier
throws:
  IllegalArgumentException - if the HostnameVerifierparameter is null.
See Also:   HttpsURLConnection.getHostnameVerifier()
See Also:   HttpsURLConnection.setDefaultHostnameVerifier(HostnameVerifier)




setSSLSocketFactory
public void setSSLSocketFactory(SSLSocketFactory sf)(Code)
Sets the SSLSocketFactory to be used when this instance creates sockets for secure https URL connections.

New instances of this class inherit the default static SSLSocketFactory set by HttpsURLConnection.setDefaultSSLSocketFactory(SSLSocketFactory)setDefaultSSLSocketFactory . Calls to this method replace this object's SSLSocketFactory.
Parameters:
  sf - the SSL socket factory
throws:
  IllegalArgumentException - if the SSLSocketFactoryparameter is null.
See Also:   HttpsURLConnection.getSSLSocketFactory()




Fields inherited from java.net.HttpURLConnection
final public static int HTTP_ACCEPTED(Code)(Java Doc)
final public static int HTTP_BAD_GATEWAY(Code)(Java Doc)
final public static int HTTP_BAD_METHOD(Code)(Java Doc)
final public static int HTTP_BAD_REQUEST(Code)(Java Doc)
final public static int HTTP_CLIENT_TIMEOUT(Code)(Java Doc)
final public static int HTTP_CONFLICT(Code)(Java Doc)
final public static int HTTP_CREATED(Code)(Java Doc)
final public static int HTTP_ENTITY_TOO_LARGE(Code)(Java Doc)
final public static int HTTP_FORBIDDEN(Code)(Java Doc)
final public static int HTTP_GATEWAY_TIMEOUT(Code)(Java Doc)
final public static int HTTP_GONE(Code)(Java Doc)
final public static int HTTP_INTERNAL_ERROR(Code)(Java Doc)
final public static int HTTP_LENGTH_REQUIRED(Code)(Java Doc)
final public static int HTTP_MOVED_PERM(Code)(Java Doc)
final public static int HTTP_MOVED_TEMP(Code)(Java Doc)
final public static int HTTP_MULT_CHOICE(Code)(Java Doc)
final public static int HTTP_NOT_ACCEPTABLE(Code)(Java Doc)
final public static int HTTP_NOT_AUTHORITATIVE(Code)(Java Doc)
final public static int HTTP_NOT_FOUND(Code)(Java Doc)
final public static int HTTP_NOT_IMPLEMENTED(Code)(Java Doc)
final public static int HTTP_NOT_MODIFIED(Code)(Java Doc)
final public static int HTTP_NO_CONTENT(Code)(Java Doc)
final public static int HTTP_OK(Code)(Java Doc)
final public static int HTTP_PARTIAL(Code)(Java Doc)
final public static int HTTP_PAYMENT_REQUIRED(Code)(Java Doc)
final public static int HTTP_PRECON_FAILED(Code)(Java Doc)
final public static int HTTP_PROXY_AUTH(Code)(Java Doc)
final public static int HTTP_REQ_TOO_LONG(Code)(Java Doc)
final public static int HTTP_RESET(Code)(Java Doc)
final public static int HTTP_SEE_OTHER(Code)(Java Doc)
final public static int HTTP_SERVER_ERROR(Code)(Java Doc)
final public static int HTTP_UNAUTHORIZED(Code)(Java Doc)
final public static int HTTP_UNAVAILABLE(Code)(Java Doc)
final public static int HTTP_UNSUPPORTED_TYPE(Code)(Java Doc)
final public static int HTTP_USE_PROXY(Code)(Java Doc)
final public static int HTTP_VERSION(Code)(Java Doc)
protected int chunkLength(Code)(Java Doc)
protected int fixedContentLength(Code)(Java Doc)
protected boolean instanceFollowRedirects(Code)(Java Doc)
protected String method(Code)(Java Doc)
protected int responseCode(Code)(Java Doc)
protected String responseMessage(Code)(Java Doc)

Methods inherited from java.net.HttpURLConnection
abstract public void disconnect()(Code)(Java Doc)
public InputStream getErrorStream()(Code)(Java Doc)
public static boolean getFollowRedirects()(Code)(Java Doc)
public String getHeaderField(int n)(Code)(Java Doc)
public long getHeaderFieldDate(String name, long Default)(Code)(Java Doc)
public String getHeaderFieldKey(int n)(Code)(Java Doc)
public boolean getInstanceFollowRedirects()(Code)(Java Doc)
public Permission getPermission() throws IOException(Code)(Java Doc)
public String getRequestMethod()(Code)(Java Doc)
public int getResponseCode() throws IOException(Code)(Java Doc)
public String getResponseMessage() throws IOException(Code)(Java Doc)
public void setChunkedStreamingMode(int chunklen)(Code)(Java Doc)
public void setFixedLengthStreamingMode(int contentLength)(Code)(Java Doc)
public static void setFollowRedirects(boolean set)(Code)(Java Doc)
public void setInstanceFollowRedirects(boolean followRedirects)(Code)(Java Doc)
public void setRequestMethod(String method) throws ProtocolException(Code)(Java Doc)
abstract public boolean usingProxy()(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.