Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
= [android-developers] Proguard causes problems with SSL keystore on Android
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mathias Lin  
View profile  
 More options Nov 18 2011, 12:05 am
From: Mathias Lin <m...@mathiaslin.com>
Date: Thu, 17 Nov 2011 21:05:05 -0800 (PST)
Local: Fri, Nov 18 2011 12:05 am
Subject: [ http://make-money-training.blogspot.com ]= [android-developers] Proguard causes problems with SSL keystore on Android

In an Android app, I fetch content from a https url; in order to avoid SSL
cert verification errors, I add the SSL public key to my keystore, which
then resides in my res/raw folder of the app. Following the instructions as
on http://blog.crazybob.org/2010/02/android-trusting-ssl-certificates.html,
which all works fine so far.

..until I activate Proguard and obfuscation. With Proguard activated, I am
getting the following error,

ERROR/Login(4401): Could not login.
    javax.net.ssl.SSLException: hostname in certificate didn't match: <store.mydomain.com/185.165.192.15> != <store.mydomain.com> OR <store.mydomain.com>
    at xyz.fd.a(Unknown Source)

which I don't quite understand. Why would the identification of the url
change in a way that it's also fetching the /<ipAddress> together with the
domain name, whereas it works fine without Proguard obfuscation.

As the httpClient for fetching the https content, I use sources as in
MyHttpClient at:
http://blog.crazybob.org/2010/02/android-trusting-ssl-certificates.html

proguard.cfg:

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference

-keep class * extends DefaultHttpClient

-ignorewarnings
-repackageclasses 'xyz'
-allowaccessmodification

-keepclasseswithmembernames class * {
    native <methods>;

}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);

}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);

}

-keepclassmembers class * extends android.app.Activity {
   public void *(android.view.View);

}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);

}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;

}

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Go to Master Mind Web Earner Blog  :-

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "= Re: [android-developers] Proguard causes problems with SSL keystore on Android" by Nikolay Elenkov
Nikolay Elenkov  
View profile  
 More options Nov 18 2011, 12:20 am
From: Nikolay Elenkov <nikolay.elen...@gmail.com>
Date: Fri, 18 Nov 2011 14:20:21 +0900
Local: Fri, Nov 18 2011 12:20 am
Subject: [ http://make-money-training.blogspot.com ]= Re: [android-developers] Proguard causes problems with SSL keystore on Android

Try dropping the more aggressive options like -repackageclasses and
-allowaccessmodification options and see if that changes anything.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Go to Master Mind Web Earner Blog  :-

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mathias Lin  
View profile   Translate to Translated (View Original)
 More options Nov 18 2011, 3:40 am
From: Mathias Lin <m...@mathiaslin.com>
Date: Fri, 18 Nov 2011 00:40:20 -0800 (PST)
Local: Fri, Nov 18 2011 3:40 am
Subject: [ http://make-money-training.blogspot.com ]= Re: [android-developers] Proguard causes problems with SSL keystore on Android

I removed -repackageclasses and -allowaccessmodification, but no difference
- getting the same error.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Go to Master Mind Web Earner Blog  :-

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Carlos A. M. dos Santos  
View profile  
 More options Nov 18 2011, 4:08 am
From: "Carlos A. M. dos Santos" <unixma...@gmail.com>
Date: Fri, 18 Nov 2011 07:08:45 -0200
Local: Fri, Nov 18 2011 4:08 am
Subject: [ http://make-money-training.blogspot.com ]= Re: [android-developers] Proguard causes problems with SSL keystore on Android

It is not fetching the IP address. The
"store.mydomain.com/185.165.192.15" you see is just the result of
InetAddress.toString(). Please post the entire stack trace contained
in the exception. Also, tell proguard to keep line numbers and file
names:

-keepattributes SourceFile,LineNumberTable

--
"The flames are all long gone, but the pain lingers on"

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Go to Master Mind Web Earner Blog  :-

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mathias Lin  
View profile  
 More options Nov 18 2011, 4:21 am
From: Mathias Lin <m...@mathiaslin.com>
Date: Fri, 18 Nov 2011 01:21:15 -0800 (PST)
Local: Fri, Nov 18 2011 4:21 am
Subject: [ http://make-money-training.blogspot.com ]= Re: [android-developers] Proguard causes problems with SSL keystore on Android

This is the complete stacktrace:

11-18 17:17:39.403: ERROR/Login(7025): Could not login.
        javax.net.ssl.SSLException: hostname in certificate didn't match:
<store.mydomain.com/185.165.192.15> != <store.mydomain.com> OR
<store.mydomain.com>
        at a.a.a.c.d.a.a(AbstractVerifier.java:228)
        at a.a.a.c.d.c.a(BrowserCompatHostnameVerifier.java:54)
        at a.a.a.c.d.a.a(AbstractVerifier.java:149)
        at a.a.a.c.d.a.a(AbstractVerifier.java:130)
        at a.a.a.c.d.d.a(SSLSocketFactory.java:397)
        at a.a.a.c.d.d.a(SSLSocketFactory.java:495)
        at a.a.a.c.c.i.a(SchemeSocketFactoryAdaptor.java:62)
        at a.a.a.f.c.f.a(DefaultClientConnectionOperator.java:148)
        at a.a.a.f.c.b.a(AbstractPoolEntry.java:149)
        at a.a.a.f.c.c.a(AbstractPooledConnAdapter.java:121)
        at a.a.a.f.b.l.a(DefaultRequestDirector.java:573)
        at a.a.a.f.b.l.a(DefaultRequestDirector.java:425)
        at a.a.a.f.b.b.a(AbstractHttpClient.java:820)
        at a.a.a.f.b.b.a(AbstractHttpClient.java:754)
        at com.mydomain.android.activity.f.doInBackground(Login.java:122)
        at android.os.AsyncTask$2.call(AsyncTask.java:185)
        at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1 088)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java: 581)
        at java.lang.Thread.run(Thread.java:1019)

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Go to Master Mind Web Earner Blog  :-

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mathias Lin  
View profile  
 More options Nov 18 2011, 4:37 am
From: Mathias Lin <m...@mathiaslin.com>
Date: Fri, 18 Nov 2011 01:37:09 -0800 (PST)
Local: Fri, Nov 18 2011 4:37 am
Subject: [ http://make-money-training.blogspot.com ]= Re: [android-developers] Proguard causes problems with SSL keystore on Android

I was using the latest httpclient 4.1.2. Now when I switch back to 4.1.1,
the problem is gone.
Also see: http://comments.gmane.org/gmane.comp.apache.httpclient.user/262

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Go to Master Mind Web Earner Blog  :-

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/

http://make-money-training.blogspot.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »