views:

363

answers:

1

Hi, I have followed the answer to http://stackoverflow.com/questions/950885/http-authentication-in-j2me by setting the request property for HttpConnection object with

setRequestProperty("Authorization", "Basic "+ encodedUserAndPass)

but it didn't work.

  • When make request to Http protocol -> 401 Unauthorized
  • When make request to Https protocol -> javax.microedition.pki.CertificateException: Certificate was issued by an unrecognized entity.

Has anyone have the problem solved? Thanks in advance.

A: 

You probably have two separate problems

1) Make sure you have Base64 encoded the details

2) For ssl make sure the certificate you are using on the webserver is signed by an authority that there is an appropriate root certificate installed for on the device you are testing with

kgutteridge