On bugs.sun.com I've found workarround - read getErrorStream instead
of getInputStream (when httpcode >= 400).
It works fine but when I try to convert this stream into string using
solution from 
http://www.java2s.com/Code/Java/File-Input-Output/ConvertInputStreamtoString.htm
than have NullPointerException in creating bufferedreader
BufferedReader reader = new BufferedReader(is);


On 11 Lut, 17:00, joebowbeer <[email protected]> wrote:
> 3) Bob Lee explains how to get certificate from the server and add to
> keystore.
>
> http://crazybob.org/2010/02/android-trusting-ssl-certificates.html
>
> Concerning #2 (getResponseCode throws an exception), see workaround in
> this bug report:
>
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4523989
>
> See bugs 4513568 and 4160499 for more HttpUrlConnection workarounds.
>
> On Feb 9, 5:23 am, badzio <[email protected]> wrote:
>
> > Hi all,
>
> > I want to use HttpPost over https/ssl.
> > I get 'Not trusted server certificate' error. I've found a lot of
> > posts, seems that many people have similar problems and I've found two
> > suggestions:
> > 1) Change server's certificate. Current certificate is self-signed as
> > localhost.localdomain. Unfortunetly it's not my server and I cannot
> > change the certificate.
> > 2) Use HttpsUrlConnection instead of HttpClient. But I cannot use it
> > because sometimes (when response's code is 401 or 403) I got
> > IOException during getting response code or reading inputstream.
>
> > So I've found 3rd solution - use httpclient, when system throws
> > excetpion 'not trusted server certificate' than display warning,
> > inform user that certificate is not trusted and ask if he wants to add
> > this one to the keystore (webbrowser works this way). But I've no idea
> > how to get certificate from the server and add to keystore.
>
> > Any idea?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" 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/android-developers?hl=en

Reply via email to