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

Commit

Permalink
added in Apache HTTPClient hostname verifier as our default
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed Aug 3, 2014
1 parent 39fe9d8 commit 3f150da
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
import android.os.AsyncTask;
import android.os.RemoteException;
import android.util.Log;
import ch.boye.httpclientandroidlib.conn.ssl.StrictHostnameVerifier;
import de.duenndns.ssl.MemorizingTrustManager;

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

mConfig.setHostnameVerifier(new StrictHostnameVerifier() );

mConnection.login(mUsername, mPassword, mResource);

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

}


// Runs in executor thread
private void initConnection(Imps.ProviderSettings.QueryMap providerSettings, String userName) throws NoSuchAlgorithmException, KeyManagementException, XMPPException {
Expand Down Expand Up @@ -1168,6 +1172,8 @@ else if (mIsGoogleAuth)
mConfig.setNotMatchingDomainCheckEnabled(false);
mConfig.setSelfSignedCertificateEnabled(true);
}

// mConfig.setHostnameVerifier();

if (mIsGoogleAuth)
{
Expand Down

0 comments on commit 3f150da

Please sign in to comment.