function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
FandangoFandango 

Reading the page contents in a variable

I'm getting the following error message while trying to read a page from salesforce.com in a variable after logging in to salesforce.

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

What do I do to fix it ?

Here is the code:

...
...
URL url = new URL("https", proxyServer, portNumber, salesforce_url);
URLConnection c = url.openConnection();
c.setDoOutput(true);
c.setUseCaches(false);
c.setRequestProperty("content-type","application/x-www-form-urlencoded");
DataOutputStream dataout = new DataOutputStream(c.getOutputStream());
dataout.writeBytes(encoded);
dataout.flush();
dataout.close();
BufferedReader in = new BufferedReader ( new InputStreamReader(c.getInputStream() ) );
...
...
DevAngelDevAngel

Hi fandango,

Unfortunately, we don't endorse screen scraping.  As such, you will need to look elsewhere to determine how to fix.  It is entirely possible to do what you are doing and I know that other are doing the same.