Skip to content
This repository was archived by the owner on Jan 25, 2018. It is now read-only.

Commit 3f150da

Browse files
committed
added in Apache HTTPClient hostname verifier as our default
1 parent 39fe9d8 commit 3f150da

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/info/guardianproject/otr/app/im/plugin/xmpp/XmppConnection.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
import android.os.AsyncTask;
127127
import android.os.RemoteException;
128128
import android.util.Log;
129+
import ch.boye.httpclientandroidlib.conn.ssl.StrictHostnameVerifier;
129130
import de.duenndns.ssl.MemorizingTrustManager;
130131

131132
public class XmppConnection extends ImConnection implements CallbackHandler {
@@ -980,6 +981,8 @@ private void initConnectionAndLogin (Imps.ProviderSettings.QueryMap providerSett
980981
//disable compression based on statement by Ge0rg
981982
mConfig.setCompressionEnabled(false);
982983

984+
mConfig.setHostnameVerifier(new StrictHostnameVerifier() );
985+
983986
mConnection.login(mUsername, mPassword, mResource);
984987

985988
mStreamHandler.notifyInitialLogin();
@@ -993,6 +996,7 @@ private void initConnectionAndLogin (Imps.ProviderSettings.QueryMap providerSett
993996
getContactListManager().listenToRoster(mRoster);
994997

995998
}
999+
9961000

9971001
// Runs in executor thread
9981002
private void initConnection(Imps.ProviderSettings.QueryMap providerSettings, String userName) throws NoSuchAlgorithmException, KeyManagementException, XMPPException {
@@ -1168,6 +1172,8 @@ else if (mIsGoogleAuth)
11681172
mConfig.setNotMatchingDomainCheckEnabled(false);
11691173
mConfig.setSelfSignedCertificateEnabled(true);
11701174
}
1175+
1176+
// mConfig.setHostnameVerifier();
11711177

11721178
if (mIsGoogleAuth)
11731179
{

0 commit comments

Comments
 (0)