Android程序通过应用程序登录Gmail

时间:2015-02-24 02:16:12

标签: java android ssl gmail

我使用java开发了一个桌面应用程序。在该应用程序中,我使用以下代码登录Gmail:

Properties props = new Properties();
props.setProperty("mail.store.protocol", "imaps");
Session session = Session.getInstance(props, null);
Store store = session.getStore();
store.connect("imap.gmail.com", uname1, password);

现在我正在尝试将同一桌面应用程序转换为Android应用程序。我使用相同的代码进行登录。我在后台进程中运行它。但我收到以下错误:

02-24 02:09:45.256: D/Running Method(1146): javax.mail.MessagingException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.;
02-24 02:09:45.256: D/Running Method(1146):   nested exception is:
02-24 02:09:45.256: D/Running Method(1146):     javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

请解决我的问题。提前谢谢。

0 个答案:

没有答案
相关问题