hello
i am trying to get search data from bing...and it has a https url and even has user name and password to access it...when i am using it on normal pc browser it works fine.but when i am tring to redirect it to mobile browser it says [B]secure connection not available[/B].and when i am using it through code to get the data using the following code
[CODE]connection = (HttpConnection) Connector.open(baseURL);
connection.setRequestMethod(HttpConnection.GET);
connection.setRequestProperty("User-Agent",
"Profile/MIDP-1.0 Configuration/CLDC-1.0");
String accountKey = "d8I62wTYbZSFwVb+HI/CK=";
String actkey=accountKey + ":" + accountKey;
String accountKeyEnc = Base64.base64Encode((actkey).getBytes());
String accountKeyEnc = Base64.base64Encode((accountKey + ":" + accountKey).getBytes());
connection.setRequestProperty("Authorization", "Basic " + accountKeyEnc);
connection.setRequestProperty("Content-Type", "text/plain");
connection.setRequestProperty("Content-Length", "0");
connection.setRequestProperty("Content-Language", "en-US");
connection.setRequestProperty("Connection", "close");
connection.setRequestProperty("Accept", "text/plain");
System.out.println("Status Line Code: "
+ connection.getResponseCode());
System.out.println("Status Line Message: "
+ connection.getResponseMessage());
if (connection.getResponseCode() == HttpConnection.HTTP_OK) {
System.out.println(connection.getHeaderField(0) + " "
+ connection.getHeaderFieldKey(0));
System.out.println("Header Field Date: "
+ connection.getHeaderField("date"));
inputstream = connection.openInputStream();
int length = (int) connection.getLength();
if (length != -1) {
byte incomingData[] = new byte[length];
inputstream.read(incomingData);
str = new String(incomingData);
} else {
ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
int ch;
while ((ch = inputstream.read()) != -1) {
bytestream.write(ch);
}
str = new String(bytestream.toByteArray());
bytestream.close();
}
System.out.println(str);[/CODE]
i am getting 60 http error
please do help me i am struck
