public class SecureConnector extends Object
| Constructor and Description |
|---|
SecureConnector(String secureSocketProtocol)
The
secure connections built by this object will
not authenticate the server endpoint, but they will use the given secure socket protocol
to encrypt the connection traffic. |
SecureConnector(String secureSocketProtocol,
File truststoreFile,
String truststorePassword,
String truststoreType,
String truststoreAlgorithm)
The
secure connections built by this object will
authenticate the server endpoint using the given truststore file and its related parameters. |
| Modifier and Type | Method and Description |
|---|---|
String |
getSecureSocketProtocol() |
String |
getTruststoreAlgorithm() |
File |
getTruststoreFile() |
String |
getTruststorePassword() |
String |
getTruststoreType() |
static void |
main(String[] args) |
HttpsURLConnection |
openSecureConnection(URL url) |
public SecureConnector(String secureSocketProtocol)
secure connections built by this object will
not authenticate the server endpoint, but they will use the given secure socket protocol
to encrypt the connection traffic.secureSocketProtocol - the secure socket protocol to use (e.g. "TLS")public SecureConnector(String secureSocketProtocol, File truststoreFile, String truststorePassword, String truststoreType, String truststoreAlgorithm)
secure connections built by this object will
authenticate the server endpoint using the given truststore file and its related parameters.
The connection will use the given secure socket protocol to encrypt the connection traffic.
Note that if the given truststoreFile is null, the other
truststore parameters are ignored and the secure connections built by this object will
not authenticate the server endpoint.secureSocketProtocol - the secure socket protocol to use (e.g. "TLS")truststoreFile - the truststore file containing authorized certificatestruststorePassword - the password to the truststore file (if a file is given, this must not be null)truststoreType - the type of the truststore file (e.g. "JKS"); if null, then the JVM's
default type is used (see java.security.KeyStore.getDefaultType())truststoreAlgorithm - the standard name of the trust management algorithm (e.g. "SunX509");
if null, then the JVM's default algorithm is used (see
javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm())public HttpsURLConnection openSecureConnection(URL url) throws Exception
Exceptionpublic String getSecureSocketProtocol()
public File getTruststoreFile()
public String getTruststorePassword()
public String getTruststoreType()
public String getTruststoreAlgorithm()
Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.