Can any body tell me how to open Https connection I use the following code
Using java Syntax Highlighting
- try {
- URL page = new URL(LoginURL);
- URLConnection conn = (HttpURLConnection) page.openConnection(proxy);
- // Construct data
- String data = URLEncoder.encode("Email", "UTF-8") + "="
- + URLEncoder.encode(Email, "UTF-8");
- data += "&" + URLEncoder.encode("Passwd", "UTF-8") + "="
- + URLEncoder.encode(Passwrd, "UTF-8");
- // Send data
- conn.setDoOutput(true);
- OutputStreamWriter wr = new OutputStreamWriter(conn
- .getOutputStream());
- wr.write(data);
- wr.flush();
- fr = conn.getInputStream();
- int len = conn.getContentLength();
- while (((c = fr.read()) != -1) && (--len > 0)) {
- buffer.append((char) c);
- }
- index = buffer.indexOf("Auth");
- } catch (MalformedURLException mue) {
- System.out.println("Bad URL: " + mue.toString());
- } catch (IOException mue) {
- System.out.println("Bad URL: " + mue.toString());
- } finally {
- if (fr != null)
- try {
- fr.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
and getting Exception SSL handshake failure . Can any body tell me how to connect using SSL in Android
Regards
riz




