Skip to content
obra edited this page Feb 4, 2011 · 3 revisions

How can I integrate MTM into my project?

It consists of three easy steps:

1. Add the directory path of MTM to your default.properties:

...
android.library.reference.1=../MemorizingTrustManager

2. Add the MTM activity into the application part of your AndroidManifest.xml:

                ...
                <activity android:name="de.duenndns.ssl.MemorizingActivity" />
        </application>
</manifest>

3. Hook MemorizingTrustManager as the default TrustManager for your connection type:

			// register MemorizingTrustManager for HTTPS
			SSLContext sc = SSLContext.getInstance("TLS");
			sc.init(null, MemorizingTrustManager.getInstanceList(this),
					new java.security.SecureRandom());
			HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
Clone this wiki locally