store SSLSocket after starttls to fix channel binding mechanism detection
This commit is contained in:
parent
68eb17d400
commit
55a77c083f
|
@ -1260,8 +1260,9 @@ public class XmppConnection implements Runnable {
|
||||||
tagReader.readTag();
|
tagReader.readTag();
|
||||||
final Socket socket = this.socket;
|
final Socket socket = this.socket;
|
||||||
final SSLSocket sslSocket = upgradeSocketToTls(socket);
|
final SSLSocket sslSocket = upgradeSocketToTls(socket);
|
||||||
tagReader.setInputStream(sslSocket.getInputStream());
|
this.socket = sslSocket;
|
||||||
tagWriter.setOutputStream(sslSocket.getOutputStream());
|
this.tagReader.setInputStream(sslSocket.getInputStream());
|
||||||
|
this.tagWriter.setOutputStream(sslSocket.getOutputStream());
|
||||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": TLS connection established");
|
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": TLS connection established");
|
||||||
final boolean quickStart;
|
final boolean quickStart;
|
||||||
try {
|
try {
|
||||||
|
@ -2218,9 +2219,13 @@ public class XmppConnection implements Runnable {
|
||||||
|
|
||||||
private boolean establishStream(final SSLSockets.Version sslVersion)
|
private boolean establishStream(final SSLSockets.Version sslVersion)
|
||||||
throws IOException, InterruptedException {
|
throws IOException, InterruptedException {
|
||||||
final SaslMechanism quickStartMechanism =
|
|
||||||
SaslMechanism.ensureAvailable(account.getQuickStartMechanism(), sslVersion);
|
|
||||||
final boolean secureConnection = sslVersion != SSLSockets.Version.NONE;
|
final boolean secureConnection = sslVersion != SSLSockets.Version.NONE;
|
||||||
|
final SaslMechanism quickStartMechanism;
|
||||||
|
if (secureConnection) {
|
||||||
|
quickStartMechanism = SaslMechanism.ensureAvailable(account.getQuickStartMechanism(), sslVersion);
|
||||||
|
} else {
|
||||||
|
quickStartMechanism = null;
|
||||||
|
}
|
||||||
if (secureConnection
|
if (secureConnection
|
||||||
&& Config.QUICKSTART_ENABLED
|
&& Config.QUICKSTART_ENABLED
|
||||||
&& quickStartMechanism != null
|
&& quickStartMechanism != null
|
||||||
|
|
Loading…
Reference in a new issue