I found out at http://jcs.mobile-utopia.com/jcs/6622_CertificateException.java
that 'Certificate was issued by an unrecognized entity' is the most
important reason. The reason says:  UNRECOGNIZED_ISSUER

At 
http://www.j2meforums.com/forum/index.php?PHPSESSID=2f414d70a50123a17b390d7debf7f65b&action=printpage;topic=8492.0
I found out that it also may be related to the j2me environment (or
the WTK toolkit environment). The way it handles certificates may be
the issue.

For me the problem is not yet solved unfortunately.

In the stack trace i found out that I indirectly use a X509
certificate. When I looked at 
http://en.wikipedia.org/wiki/X.509#Sample_X.509_certificates
i found out what it was what I needed: a certificate with indeed an
issuer. Probably I must create a signed certificate or so...
How does google implement x509 certificates? And why is it sometimes
working and sometimes not?

I guess a certificate runs out of date after a while???



On Dec 28, 10:26 pm, hs <[email protected]> wrote:
> Hello, I'm working at a J2ME implementation of the google API for
> calendar information. I decided to use the clientlogin protocol to
> retrieve an authorization key.
>
> At a very irregular basis I get an error in the following code. Can
> you help me with figuring out what causes this error? (because the
> error is irregular, I suppose it has to do something with the Google
> service).
>
> ERROR:
> CalendarAdapter.clientLogin():
> javax.microedition.pki.CertificateException: Certificate was issued by
> an unrecognized entity wrong response: 401
> Uncaught exception java/lang/NullPointerException.
>
> <code>
> private void clientLogin() {
>
>         //For connection
>         HttpConnection connection = null;
>
>         //Parameters for client login
>         String url              =       
> "https://www.google.com/accounts/ClientLogin";;
>         String email    =       "[email protected]";
>         String passwd   =       "Passwd=******";
>         String source   =       "source=******";
>         String service  =       "service=cl";
>         byte [] data    =       
> (email+"&"+passwd+"&"+source+"&"+service).getBytes
> ();
>         authKey                 =       "";
>
>         try {
>                 connection      =       (HttpConnection)Connector.open(url);
>                 connection.setRequestMethod(HttpConnection.POST);
>                 connection.setRequestProperty("Content-Type", 
> "application/x-www-
> form-urlencoded");
>                 OutputStream outputstream       =       
> connection.openOutputStream ();
>                 outputstream.write(data);
>                 outputstream.close ();
>                 String contents;
>
>                 contents        =       this.getData(connection);
>                 authKey         =       
> contents.substring(contents.indexOf("Auth=")+5).trim();
>
>         }
>         catch(IOException e) {
>                 System.out.println("GoogleCalendarClient.clientLogin(): 
> "+e.toString
> ());
>                 return;
>         }
>
> }
>
> </code>

--

You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en.


Reply via email to