java.lang.Object
com.sun.net.httpserver.HttpsParameters
Represents the set of parameters for each https connection negotiated with
clients. One of these is created and passed to
HttpsConfigurator.configure(HttpsParameters)
for every incoming https
connection, in order to determine the parameters to use.
The underlying SSL parameters may be established either via the set/get
methods of this class, or else via a SSLParameters
object. SSLParameters
is the preferred method, because in the future,
additional configuration capabilities may be added to that class, and it is
easier to determine the set of supported parameters and their default values
with SSLParameters. Also, if an SSLParameters
object is provided via
setSSLParameters(SSLParameters)
then those parameter settings are
used, and any settings made in this object are ignored.
- Since:
- 1.6
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionString[]
Returns a copy of the array of ciphersuites ornull
if none have been set.abstract InetSocketAddress
Returns the address of the remote client initiating the connection.abstract HttpsConfigurator
Returns theHttpsConfigurator
for thisHttpsParameters
.boolean
Returns whether client authentication should be required.String[]
Returns a copy of the array of protocols ornull
if none have been set.boolean
Returns whether client authentication should be requested.void
setCipherSuites
(String[] cipherSuites) Sets the array of ciphersuites.void
setNeedClientAuth
(boolean needClientAuth) Sets whether client authentication should be required.void
setProtocols
(String[] protocols) Sets the array of protocols.abstract void
setSSLParameters
(SSLParameters params) Sets theSSLParameters
to use for thisHttpsParameters
.void
setWantClientAuth
(boolean wantClientAuth) Sets whether client authentication should be requested.
-
Constructor Details
-
HttpsParameters
protected HttpsParameters()Constructor for subclasses to call.
-
-
Method Details
-
getHttpsConfigurator
Returns theHttpsConfigurator
for thisHttpsParameters
.- Returns:
HttpsConfigurator
for this instance ofHttpsParameters
-
getClientAddress
Returns the address of the remote client initiating the connection.- Returns:
- address of the remote client initiating the connection
-
setSSLParameters
Sets theSSLParameters
to use for thisHttpsParameters
. The parameters must be supported by theSSLContext
contained by theHttpsConfigurator
associated with thisHttpsParameters
. If no parameters are set, then the default behavior is to use the default parameters from the associatedSSLContext
.- Parameters:
params
- theSSLParameters
to set. Ifnull
then the existing parameters (if any) remain unchanged- Throws:
IllegalArgumentException
- if any of the parameters are invalid or unsupported
-
getCipherSuites
Returns a copy of the array of ciphersuites ornull
if none have been set.- Returns:
- a copy of the array of ciphersuites or
null
if none have been set
-
setCipherSuites
Sets the array of ciphersuites.- Parameters:
cipherSuites
- the array of ciphersuites (ornull
)
-
getProtocols
Returns a copy of the array of protocols ornull
if none have been set.- Returns:
- a copy of the array of protocols or
null
if none have been set
-
setProtocols
Sets the array of protocols.- Parameters:
protocols
- the array of protocols (ornull
)
-
getWantClientAuth
public boolean getWantClientAuth()Returns whether client authentication should be requested.- Returns:
- whether client authentication should be requested
-
setWantClientAuth
public void setWantClientAuth(boolean wantClientAuth) Sets whether client authentication should be requested. Calling this method clears theneedClientAuth
flag.- Parameters:
wantClientAuth
- whether client authentication should be requested
-
getNeedClientAuth
public boolean getNeedClientAuth()Returns whether client authentication should be required.- Returns:
- whether client authentication should be required
-
setNeedClientAuth
public void setNeedClientAuth(boolean needClientAuth) Sets whether client authentication should be required. Calling this method clears thewantClientAuth
flag.- Parameters:
needClientAuth
- whether client authentication should be required
-