Not trusted server certificate error when using the api in android application

319 views
Skip to first unread message

lal sooraj C.b

unread,
Feb 18, 2013, 2:48:27 AM2/18/13
to microsoft-tran...@googlegroups.com

Hai ,

   I was able to use "microsoft-translator-java-api-0.6.1-jar-with-dependencies.jar" translator api with java project , but when i tried to use the translator api in my android application i am getting the following error , Here with i am giving the code used and error message, 

Code:

                      Translate.setClientId("MY CLIENT ID got on APPLICATION REGISTRATION");
           Translate.setClientSecret("THE Key GOT On Application registration");
           try {
translatedText = Translate.execute("I should probably set this to something a little less profane", Language.ENGLISH, Language.FRENCH);

           } catch(Exception e) {
translatedText = e.toString();
Log.d("test",e.toString());
           }

Error:    java.lang.Exception: [microsoft-translator-api] Error retrieving translation : Not trusted server certificate

Please provide some leads to solve this issue.

Best regards,

Lal Sooraj C.B

Olexander Danchuk

unread,
Feb 18, 2013, 12:06:25 PM2/18/13
to microsoft-tran...@googlegroups.com
That means that in your android phone (system certificate storage) doesn't have certificate that Microsoft uses on their server.
That could easily be solved by implementing custom TrustManager for you SSL(HTTPS) connection. I need to double check but looks like you should modify microsoft-translator-java-api-0.6.1-jar-with-dependencies.jar in  order to inject Custom Trust manager.

Let me know if you don't know how. I will post the solution.

Regards,
Oleksandr

Thank you for your time and I look forward to your mails


--
You received this message because you are subscribed to the Google Groups "microsoft-translator-java-api" group.
To unsubscribe from this group and stop receiving emails from it, send an email to microsoft-translator...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

lal sooraj C.b

unread,
Feb 19, 2013, 12:02:43 AM2/19/13
to microsoft-tran...@googlegroups.com
Thanks for Your reply,

    I was able to get the desired out come in my device when i publish the application as .apk file, But i am getting this error only in the emulator during normal debug where as same code is working fine as java project. So it becomes difficult to debug my application from my pc. Please note that i am working with eclipse indigo installed in a 64 bit windows pc.

Best regards,
Lal Sooraj C.B
To unsubscribe from this group and stop receiving emails from it, send an email to microsoft-translator-java-api+unsub...@googlegroups.com.

Olexander Danchuk

unread,
Feb 19, 2013, 3:44:25 AM2/19/13
to microsoft-tran...@googlegroups.com
Oh..I see.
You can try latest emulator. may be certificate comes with latest emulator. if not  you may want to install it.

In order to install Microsoft certificate into Android emulator you need to install Microsoft certificate (that one that Microsoft server uses). Unfortunately, I have not done this. But I know for sure that starting from Android 4.0 you can import certificate from SD card. Import procedure will copy *.pfx or  *. cer certificate from SD card into system certificate store and  another system certificate store that is for WiFI and VPN. Emulator may have this functionality too.

Please, try to copy *.cer file to emulators sdcard using adb
adb push test.cer /sdcard/

Then execute settings ->security -> import certificates
Then go to certificate viewer (also accessible from settings) and check if your test.cer installed under user certificate tab
If so then you just need to find out what certificate Microsoft uses on their translation servers. You can use Fidler for that. Then you can copy certificate form Fidler or from your local PC and install it in android emulator.

Let me know if you need more help

Regards,
Oleksandr

Thank you for your time and I look forward to your mails


To unsubscribe from this group and stop receiving emails from it, send an email to microsoft-translator...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
--
You received this message because you are subscribed to the Google Groups "microsoft-translator-java-api" group.
To unsubscribe from this group and stop receiving emails from it, send an email to microsoft-translator...@googlegroups.com.

lal sooraj C.b

unread,
Feb 21, 2013, 11:37:46 PM2/21/13
to microsoft-tran...@googlegroups.com
Thanks for your reply , Hope this will solve my issue , and will get back to you if i couldn't ... Thanks a lot...
To unsubscribe from this group and stop receiving emails from it, send an email to microsoft-translator-java-api+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
--
You received this message because you are subscribed to the Google Groups "microsoft-translator-java-api" group.
To unsubscribe from this group and stop receiving emails from it, send an email to microsoft-translator-java-api+unsub...@googlegroups.com.

Sourabh Choudhary

unread,
May 26, 2013, 2:43:24 PM5/26/13
to microsoft-tran...@googlegroups.com
I'm also getting same error but only on device and not the emulator. Please guide me. If it's a certificate issue, then please let me know how to install certificate on Android devices?

Thanks
Sourabh
To unsubscribe from this group and stop receiving emails from it, send an email to microsoft-translator-java-api+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
--
You received this message because you are subscribed to the Google Groups "microsoft-translator-java-api" group.
To unsubscribe from this group and stop receiving emails from it, send an email to microsoft-translator-java-api+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages