mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 09:39:39 +02:00
Re-worked security settings, clean-up of connection config, fixed concurrency when shutting down the packet writer.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@6666 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
5a57e2390a
commit
8e750912a7
7 changed files with 145 additions and 76 deletions
|
@ -174,7 +174,6 @@ public class XMPPConnection {
|
|||
public XMPPConnection(String serviceName) {
|
||||
// Create the configuration for this new connection
|
||||
ConnectionConfiguration config = new ConnectionConfiguration(serviceName);
|
||||
config.setTLSEnabled(true);
|
||||
config.setCompressionEnabled(false);
|
||||
config.setSASLAuthenticationEnabled(true);
|
||||
config.setDebuggerEnabled(DEBUG_ENABLED);
|
||||
|
@ -1031,9 +1030,19 @@ public class XMPPConnection {
|
|||
/**
|
||||
* Notification message saying that the server supports TLS so confirm the server that we
|
||||
* want to secure the connection.
|
||||
*
|
||||
* @param required true when the server indicates that TLS is required.
|
||||
*/
|
||||
void startTLSReceived() {
|
||||
if (!configuration.isTLSEnabled()) {
|
||||
void startTLSReceived(boolean required) {
|
||||
if (required && configuration.getSecurityMode() ==
|
||||
ConnectionConfiguration.SecurityMode.disabled)
|
||||
{
|
||||
packetReader.notifyConnectionError(new IllegalStateException(
|
||||
"TLS required by server but not allowed by connection configuration"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (configuration.getSecurityMode() == ConnectionConfiguration.SecurityMode.disabled) {
|
||||
// Do not secure the connection using TLS since TLS was disabled
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue