Skip to content

Commit

Permalink
force a TLS POST when the debug ACRA option is triggered
Browse files Browse the repository at this point in the history
added logging at level info if we're running in a debug build and someone does a POST
  • Loading branch information
crankycoder committed Sep 22, 2015
1 parent b9f20b3 commit 300f8a4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@
import org.mozilla.mozstumbler.client.serialize.KMLFragment;
import org.mozilla.mozstumbler.service.AppGlobals;
import org.mozilla.mozstumbler.service.Prefs;
import org.mozilla.mozstumbler.service.core.http.IHttpUtil;
import org.mozilla.mozstumbler.service.core.logging.ClientLog;
import org.mozilla.mozstumbler.service.stumblerthread.motiondetection.LocationChangeSensor;
import org.mozilla.mozstumbler.service.stumblerthread.motiondetection.MotionSensor;
import org.mozilla.mozstumbler.service.utils.BatteryCheckReceiver;
import org.mozilla.mozstumbler.svclocator.ServiceLocator;
import org.mozilla.mozstumbler.svclocator.services.log.LoggerUtil;
import org.mozilla.osmdroid.tileprovider.modules.SerializableTile;

import java.io.File;
import java.util.HashMap;

import static org.mozilla.mozstumbler.service.stumblerthread.datahandling.ClientDataStorageManager.sdcardArchivePath;

Expand Down Expand Up @@ -68,6 +72,12 @@ public boolean onLongClick(View v) {
public void onClick(DialogInterface dialog, int item) {
switch (item) {
case 0:
// Trigger a bad HTTPS POST to see what the TLS stuff does.
IHttpUtil httpUtil = (IHttpUtil) ServiceLocator.getInstance().getService(IHttpUtil.class);
httpUtil.post("https://location.services.mozilla.com/",
new byte[0],
new HashMap<String, String>(),
false);
Object a = null;
a.hashCode();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,10 @@ public IResponse post(String urlString, byte[] data, Map<String, String> headers
} catch (IOException e) {
ClientLog.e(LOG_TAG, "post error", e);
} finally {
String cipherSuite = ((HttpsURLConnection) httpURLConnection).getCipherSuite();
Log.d(LOG_TAG, "Negotiated HTTPS ciphers: " + cipherSuite);
if (BuildConfig.DEBUG) {
String cipherSuite = ((HttpsURLConnection) httpURLConnection).getCipherSuite();
Log.i(LOG_TAG, "Negotiated HTTPS ciphers: " + cipherSuite);
}
httpURLConnection.disconnect();
}
return null;
Expand Down

0 comments on commit 300f8a4

Please sign in to comment.