|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
public interface ISslService
This service is used to aid in loading certificates for SSL communication with other APIs. Each method generates a SSLSocketFactory instance that uses the specified client and/or server certificate(s). This socket factory may be used to generate a SSL based Socket or may be used in combination with other communication libraries (such as the HttpsURLConnection).
Methods are provided for loading and using a client certificate file with an optional password as well as overriding the trust store to use specified server or chain certificates. Certificate files may be in the PEM file format and do not need to be converted in DER as is typical of Java. It should be noted that this service is not needed when performing SSL communications with known and trusted certificates, such as when communicating with HTTPS enabled websites that do not have a self-signed certificate.Method Summary | |
---|---|
File
|
getCertificateFile(String filename)
Returns the file representing the certificate for the given filename. |
HostnameVerifier
|
getLenientHostnameVerifier()
Generates a hostname verifier that automatically trusts all host names. |
SSLSocketFactory
|
getLenientSocketFactory()
Generates a socket factory that automatically trusts all server certificates. |
SSLSocketFactory
|
getSocketFactory(String clientCertificate, String clientCertAlias)
Generates a socket factory for the specified options. |
SSLSocketFactory
|
getSocketFactory(String clientCertificate, String clientCertAlias, String clientPrivateKey, String clientKeyPassword)
Generates a socket factory for the specified options. |
SSLSocketFactory
|
getSocketFactory(String serverCertificate)
Generates a socket factory for the specified options. |
SSLSocketFactory
|
getSocketFactory(String clientCertificate, String clientCertAlias, String serverCertificate)
Generates a socket factory for the specified options. |
SSLSocketFactory
|
getSocketFactory(String clientCertificate, String clientCertAlias, String clientPrivateKey, String clientKeyPassword, String serverCertificate)
Generates a socket factory for the specified options. |
Method Detail |
---|
public File getCertificateFile(String filename)
filename
- The filename of the certificate, either absolute or relative.
public HostnameVerifier getLenientHostnameVerifier()
public SSLSocketFactory getLenientSocketFactory()
public SSLSocketFactory getSocketFactory(String clientCertificate, String clientCertAlias)
clientCertificate
- The client certificate file to useclientCertAlias
- The alias of the client certificate to use for socket communication, may be null to use the given certificate's alias
public SSLSocketFactory getSocketFactory(String clientCertificate, String clientCertAlias, String clientPrivateKey, String clientKeyPassword)
clientCertificate
- The client certificate file to useclientCertAlias
- The alias of the client certificate to use for socket communication, may be null to use the given certificate's aliasclientPrivateKey
- The client private key file to useclientKeyPassword
- The password to decrypt the client certificate private key, may be null to use an unencrypted certificate
public SSLSocketFactory getSocketFactory(String serverCertificate)
serverCertificate
- The server certificate(s) or chain certificate to use (multiple certificates may be present in this file)
public SSLSocketFactory getSocketFactory(String clientCertificate, String clientCertAlias, String serverCertificate)
clientCertificate
- The client certificate file to useclientCertAlias
- The alias of the client certificate to use for socket communication, may be null to use the given certificate's aliasserverCertificate
- The server certificate(s) or chain certificate to use (multiple certificates may be present in this file)
public SSLSocketFactory getSocketFactory(String clientCertificate, String clientCertAlias, String clientPrivateKey, String clientKeyPassword, String serverCertificate)
clientCertificate
- The client certificate file to useclientCertAlias
- The alias of the client certificate to use for socket communication, may be null to use the given certificate's aliasclientPrivateKey
- The client private key file to useclientKeyPassword
- The password to decrypt the client certificate private key, may be null to use an unencrypted certificateserverCertificate
- The server certificate(s) or chain certificate to use (multiple certificates may be present in this file)
Groovy Documentation