From: kenstir Date: Wed, 25 Nov 2015 03:15:52 +0000 (-0500) Subject: Hack to disable SSL for gapines and mlnc4.mvlcstaff.org. This issue is described... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=412c6beed7acfc04e063f4337dc6084c9af3eb03;p=working%2FEvergreen.git Hack to disable SSL for gapines and mlnc4.mvlcstaff.org. This issue is described in detail at developer.android.com/training/articles/security-ssl.html and the real workaround is more android code or changes to the site cert. --- diff --git a/Open-ILS/src/Android/core/src/org/evergreen_ils/auth/AuthenticatorActivity.java b/Open-ILS/src/Android/core/src/org/evergreen_ils/auth/AuthenticatorActivity.java index 8b2d276287..4912d4aa4b 100644 --- a/Open-ILS/src/Android/core/src/org/evergreen_ils/auth/AuthenticatorActivity.java +++ b/Open-ILS/src/Android/core/src/org/evergreen_ils/auth/AuthenticatorActivity.java @@ -28,6 +28,7 @@ import org.evergreen_ils.globals.Utils; import org.evergreen_ils.searchCatalog.Library; import org.opensrf.util.JSONException; import org.opensrf.util.JSONReader; +import org.w3c.dom.Text; import java.util.*; @@ -339,8 +340,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity { libraries.clear(); if (isDebuggable()) { - Library library = new Library("https://demo.evergreencatalog.com", "evergreencatalog.com Demo", "0ut There, US (evergreencatalog.com Demo)", null); - //Library library = new Library("http://mlnc4.mvlcstaff.org", "MVLC Demo", "0ut There, US (MVLC Demo)", null);// SSL not working + //Library library = new Library("https://demo.evergreencatalog.com", "evergreencatalog.com Demo", "0ut There, US (evergreencatalog.com Demo)", null); + Library library = new Library(cleartextHack("https://mlnc4.mvlcstaff.org"), "MVLC Demo", "0ut There, US (MVLC Demo)", null);// SSL not working libraries.add(library); } @@ -354,6 +355,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity { } for (Map map : l) { String url = (String) map.get("url"); + url = cleartextHack(url); String directory_name = (String) map.get("directory_name"); String short_name = (String) map.get("short_name"); Double latitude = (Double) map.get("latitude"); @@ -378,6 +380,21 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity { } } + private String cleartextHack(String url) { + // fixes SSL issue with gapines and other sites + if (TextUtils.equals(url, "https://gapines.org") + || TextUtils.equals(url, "https://mlnc4.mvlcstaff.org")) + { + try { + String new_url = url.replaceFirst("^https:", "http:"); + return new_url; + } catch (Exception e) { + Log.d(TAG, "caught", e); + } + } + return url; + } + public boolean isDebuggable() { return (0 != (getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE)); } diff --git a/Open-ILS/src/Android/core/src/org/evergreen_ils/auth/EvergreenAuthenticator.java b/Open-ILS/src/Android/core/src/org/evergreen_ils/auth/EvergreenAuthenticator.java index 146c8eb057..f89539602d 100644 --- a/Open-ILS/src/Android/core/src/org/evergreen_ils/auth/EvergreenAuthenticator.java +++ b/Open-ILS/src/Android/core/src/org/evergreen_ils/auth/EvergreenAuthenticator.java @@ -69,7 +69,7 @@ public class EvergreenAuthenticator { @SuppressWarnings("unchecked") public static String signIn(String library_url, String username, String password) throws AuthenticationException { - Log.d(TAG, "signIn> "+username); + Log.d(TAG, "signIn> "+username+" "+library_url); HttpConnection conn; try { diff --git a/Open-ILS/src/Android/cwmars_app/AndroidManifest.xml b/Open-ILS/src/Android/cwmars_app/AndroidManifest.xml index a6df4651fa..c1c075d6b2 100644 --- a/Open-ILS/src/Android/cwmars_app/AndroidManifest.xml +++ b/Open-ILS/src/Android/cwmars_app/AndroidManifest.xml @@ -17,6 +17,8 @@ + + @@ -24,7 +26,7 @@ diff --git a/Open-ILS/src/Android/hemlock_app/AndroidManifest.xml b/Open-ILS/src/Android/hemlock_app/AndroidManifest.xml index 0ca95db090..32a87ab60a 100644 --- a/Open-ILS/src/Android/hemlock_app/AndroidManifest.xml +++ b/Open-ILS/src/Android/hemlock_app/AndroidManifest.xml @@ -2,7 +2,7 @@ +