mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
Big change for authentication, which now supports more SASL mechanisms and
callbacks. This should address issues SMACK-210 and SMACK-142, as well as set the stage for SMACK-234. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@9498 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
85a92b600b
commit
13b8d313ba
14 changed files with 801 additions and 189 deletions
|
@ -44,6 +44,9 @@ public class ConnectionConfiguration implements Cloneable {
|
|||
private String truststorePath;
|
||||
private String truststoreType;
|
||||
private String truststorePassword;
|
||||
private String keystorePath;
|
||||
private String keystoreType;
|
||||
private String keystorePassword;
|
||||
private boolean verifyChainEnabled = false;
|
||||
private boolean verifyRootCAEnabled = false;
|
||||
private boolean selfSignedCertificateEnabled = false;
|
||||
|
@ -128,6 +131,9 @@ public class ConnectionConfiguration implements Cloneable {
|
|||
truststoreType = "jks";
|
||||
// Set the default password of the cacert file that is "changeit"
|
||||
truststorePassword = "changeit";
|
||||
keystorePath = System.getProperty("javax.net.ssl.keyStore");
|
||||
keystoreType = "jks";
|
||||
keystorePassword = "changeit";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -240,6 +246,66 @@ public class ConnectionConfiguration implements Cloneable {
|
|||
this.truststorePassword = truststorePassword;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retuns the path to the keystore file. The key store file contains the
|
||||
* certificates that may be used to authenticate the client to the server,
|
||||
* in the event the server requests or requires it.
|
||||
*
|
||||
* @return the path to the keystore file.
|
||||
*/
|
||||
public String getKeystorePath() {
|
||||
return keystorePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the path to the keystore file. The key store file contains the
|
||||
* certificates that may be used to authenticate the client to the server,
|
||||
* in the event the server requests or requires it.
|
||||
*
|
||||
* @param keystorePath the path to the keystore file.
|
||||
*/
|
||||
public void setKeystorePath(String keystorePath) {
|
||||
this.keystorePath = keystorePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the keystore type, or <tt>null</tt> if it's not set.
|
||||
*
|
||||
* @return the keystore type.
|
||||
*/
|
||||
public String getKeystoreType() {
|
||||
return keystoreType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the keystore type.
|
||||
*
|
||||
* @param keystoreType the keystore type.
|
||||
*/
|
||||
public void setKeystoreType(String keystoreType) {
|
||||
this.keystoreType = keystoreType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the password to use to access the keystore file. It is assumed that all
|
||||
* certificates share the same password in the keystore.
|
||||
*
|
||||
* @return the password to use to access the keystore file.
|
||||
*/
|
||||
public String getKeystorePassword() {
|
||||
return keystorePassword;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the password to use to access the keystore file. It is assumed that all
|
||||
* certificates share the same password in the trust store.
|
||||
*
|
||||
* @param keystorePassword the password to use to access the keystore file.
|
||||
*/
|
||||
public void setKeystorePassword(String keystorePassword) {
|
||||
this.keystorePassword = keystorePassword;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the whole chain of certificates presented by the server are going to
|
||||
* be checked. By default the certificate chain is not verified.
|
||||
|
@ -520,4 +586,4 @@ public class ConnectionConfiguration implements Cloneable {
|
|||
this.resource = resource;
|
||||
this.sendPresence = sendPresence;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue