JSSE V1.0 Implementation Problem

Eugene Larkin Work (eugene@systemchanges.com)
Sun, 22 Aug 1999 23:15:13 -0500

From: "Eugene Larkin Work" <eugene@systemchanges.com>
To: <java-security@Sun.COM>
Subject: JSSE V1.0 Implementation Problem
Date: Sun, 22 Aug 1999 23:15:13 -0500

------=_NextPart_000_000C_01BEECF4.302EC760
Content-Type: multipart/related; boundary="----=_NextPart_001_000D_01BEECF4.302EC760"
X-Sun-Content-Length: 29336

------=_NextPart_001_000D_01BEECF4.302EC760
Content-Type: multipart/alternative;
boundary="----=_NextPart_002_000E_01BEECF4.302EC760"

------=_NextPart_002_000E_01BEECF4.302EC760
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

After much haggeling with the source and limited
examples I have the following errors when I
compile my application trying to use JSSE v1.0. I
have attached the java source for the two objects.
I hoped you might have some insight as to why I am
getting these messages. Thank you in advance for
your time to look at this problem.

After doing all of the install instructions and
trying to create an executable object this is
whatI get. What is the reason. Have I got
completely off base on this project. The
documentation islimited for URL handling and I can
not find any sample code except for a promise that
SUN is goingto release some. I am trying to run
an application. I have a servlet version of this
and anapplet version as well but the application
is the most important to my development project.
The following errors are received from compiling
the upmhttpserver.java to an executable. I
havemarked the code with Route 1 and Route 2
comments. They are at lines 414 and 418
respectively. Followingis the information from
the documentation that looks easy but is actually
not.
QUOTE---------HTTPS SupportThe protocol "HTTPS" is
HTTP (used for Web browsing and other purposes),
used in conjunction with a secure socket.The JSSE
reference implementation provides a basic client
side HTTPS protocol handler. This supports
firewall tunneling, so that HTTPS clients can
access servers through firewalls which support
that tunneling (usually, only to port 443). This
means that you can write lines of Java code such
as
URL url = new URL
("https://www.sun.com/");---------END QUOTE

Useing Route 1...import java.net.URLEncoder;import
com.sun.net.ssl.internal.www.protocol.https.HttpsU
RLConnection;import
com.sun.net.ssl.internal.www.protocol.https.Handle
r;import
com.sun.net.ssl.internal.www.https.HttpsClient;...
com.sun.net.ssl.internal.www.protocol.https.Handle
r hnd = new Handler();...// route one URL
anacomURL = new
URL("https://www.anacom.com/order/testaccount/tran
saction.htm"); URLConnection connection =
hnd.openConnection(anacomURL);...
error received by compile is as follows
link @upmhttpserver.lnkError:
D:\Eugene\wwwroot\TESTHOME\servlets\Worker.obj(Wor
ker) (138584016): Symbol Undefined
_$com_sun_net_ssl_internal_www_protocol_https_Hand
ler__4init_5__Error:
D:\Eugene\wwwroot\TESTHOME\servlets\Worker.obj(Wor
ker) (138584016): Symbol Undefined
_$Classcom_sun_net_ssl_internal_www_protocol_https
_HandlerBuild Failed
Using Route 2...import java.net.URLEncoder;import
com.sun.net.ssl.internal.www.protocol.https.HttpsU
RLConnection;import
com.sun.net.ssl.internal.www.protocol.https.Handle
r;import
com.sun.net.ssl.internal.www.https.HttpsClient;...
// route two URL anacomURL = new
URL("https://www.anacom.com/order/testaccount/tran
saction.htm"); URLConnection connection = new
HttpsURLConnection(anacomURL, hnd);
link @upmhttpserver.lnkError:
D:\Eugene\wwwroot\TESTHOME\servlets\Worker.obj(Wor
ker) (138584016): Symbol Undefined
_$com_sun_net_ssl_internal_www_protocol_https_Http
sURLConnection__4init_5__Ljava_net_URL_2Lcom_sun_n
et_ssl_internal_www_protocol_https_Handler_2Error:
D:\Eugene\wwwroot\TESTHOME\servlets\Worker.obj(Wor
ker) (138584016): Symbol Undefined
_$Classcom_sun_net_ssl_internal_www_protocol_https
_HttpsURLConnectionError:
D:\Eugene\wwwroot\TESTHOME\servlets\Worker.obj(Wor
ker) (138584016): Symbol Undefined
_$com_sun_net_ssl_internal_www_protocol_https_Hand
ler__4init_5__Error:
D:\Eugene\wwwroot\TESTHOME\servlets\Worker.obj(Wor
ker) (138584016): Symbol Undefined
_$Classcom_sun_net_ssl_internal_www_protocol_https
_HandlerBuild Failed

Eugene Larkin

Phone Numbers

(972) 588-8333 Cell
(972) 390-6672 Work

EMail Addresses

mailto:eugene@systemchanges.com
Personal
mailto:ELarkin@lyrick.com Work

URL Addresses

http://www.systemchanges.com Personal
http://www.eugenelarkin.com Personal

------=_NextPart_002_000E_01BEECF4.302EC760
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

After much=20 haggeling with the source and limited examples I have the following = errors when=20 I compile my application trying to use JSSE v1.0.  I have attached = the java=20 source for the two objects.  I hoped you might have some = insight as to = why I am=20 getting these = messages.  Thank=20 you in advance for your time to look at this = problem.
 
After doing all of the install instructions and =
trying to create an executable object this is what
I get.  What = is the reason.  Have I got completely off base on this = project.  The documentation is
limited for URL handling and I = can not find any sample code except for a promise that SUN is = going
to release some.  I am trying to run an application.  = I have a servlet version of this and an
applet version as well but = the application is the most important to my development = project.
The following errors are =
received from compiling the upmhttpserver.java to an executable.  I =
have
marked the code with Route 1 and Route 2 comments.  They = are at lines 414 and 418 respectively.  Following
is the = information from the documentation that looks easy but is actually = not.
QUOTE
---------
HTTPS = Support
The protocol "HTTPS" is HTTP (used for Web browsing and other = purposes), used in conjunction with a secure socket.
The JSSE = reference implementation provides a basic client side HTTPS protocol = handler. This supports firewall tunneling, so that HTTPS clients can = access servers through firewalls which support that tunneling (usually, = only to port 443). This means that you can write lines of Java code such = as
    URL url =3D new =
URL ("https://www.sun.com/");
---------
END = QUOTE
 
Useing Route 1
...
import java.net.URLEncoder;
import = com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection;
import= com.sun.net.ssl.internal.www.protocol.https.Handler;
import = com.sun.net.ssl.internal.www.https.HttpsClient;
...
com.sun.net.ssl.internal.www.protocol.https.Handler hnd =3D new = Handler();
...



// route = one 
 URL anacomURL =3D new = URL("https://www.anacom.com/order/testaccount/transaction.htm");
= URLConnection connection =3D = hnd.openConnection(anacomURL);
...
error received by compile is =
as follows
link =
@upmhttpserver.lnk
Error: = D:\Eugene\wwwroot\TESTHOME\servlets\Worker.obj(Worker)  = (138584016): Symbol Undefined = _$com_sun_net_ssl_internal_www_protocol_https_Handler__4init_5__
Error= : D:\Eugene\wwwroot\TESTHOME\servlets\Worker.obj(Worker)  = (138584016): Symbol Undefined = _$Classcom_sun_net_ssl_internal_www_protocol_https_Handler
Build = Failed

Using Route 2
...
import java.net.URLEncoder;
import = com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection;
import= com.sun.net.ssl.internal.www.protocol.https.Handler;
import = com.sun.net.ssl.internal.www.https.HttpsClient;
...
// = route two
 URL anacomURL =3D new = URL("https://www.anacom.com/order/testaccount/transaction.htm");
 = ;URLConnection connection =3D new HttpsURLConnection(anacomURL, = hnd);

link = @upmhttpserver.lnk
Error: = D:\Eugene\wwwroot\TESTHOME\servlets\Worker.obj(Worker)  = (138584016): Symbol Undefined = _$com_sun_net_ssl_internal_www_protocol_https_HttpsURLConnection__4init_5= __Ljava_net_URL_2Lcom_sun_net_ssl_internal_www_protocol_https_Handler_2Error: D:\Eugene\wwwroot\TESTHOME\servlets\Worker.obj(Worker)  = (138584016): Symbol Undefined = _$Classcom_sun_net_ssl_internal_www_protocol_https_HttpsURLConnection
= Error: D:\Eugene\wwwroot\TESTHOME\servlets\Worker.obj(Worker)  = (138584016): Symbol Undefined = _$com_sun_net_ssl_internal_www_protocol_https_Handler__4init_5__
Error= : D:\Eugene\wwwroot\TESTHOME\servlets\Worker.obj(Worker)  = (138584016): Symbol Undefined = _$Classcom_sun_net_ssl_internal_www_protocol_https_Handler
Build = Failed
	

 

 
------=_NextPart_002_000E_01BEECF4.302EC760-- ------=_NextPart_001_000D_01BEECF4.302EC760 Content-Type: image/jpeg; name="javaperl.jpg" Content-Transfer-Encoding: base64 Content-ID: <720311204@23081999-2f02> /9j/4AAQSkZJRgABAAEAYABgAAD//gAfTEVBRCBUZWNobm9sb2dpZXMgSW5jLiBWMS4wMQD/2wCE AAQDAwMDAgQDAwMFBAQFBgsHBgYGBg0JCggLEA4REA8ODw8RFBkVERMYEw8PFh4WGBobHB0cERUf IR8cIRkcHBsBBAUFBgUGDQcHDRsSDxIbGxsbGxsbGxsbGxs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SfzrVRS2OWVWb3Z2nwj5+Mmje/nf8A ol6uOjOOvrTb/rc+o62PIEY7Vz6UAcb4W8O6Dpu6707TzFKTsLvIZGA9ienWs6VOMF7qPZx+LxFZ qFSWn3HWxjEYI781seSOoAKACgAAA6DFABjFAjlfiB4nbwf4QfWlshdkOsYj8zy+p65wfb8qWwHz V8PPHs/grVL2UWAvYbuNUeMS+UdwI2tuCnoGIx70bAfUquHiibZjeA3bjp6fWmMaUBlUH/PT/AUA LDAsoVjgHcF6fSgBYwAivg7gByT6/wD66YEsaDzBGOi4GPy/xpAWFhC7SMcqOMfSgByKDInYHGB6 dP8AGgBS4GBt7D09PpSA/9k= ------=_NextPart_001_000D_01BEECF4.302EC760-- ------=_NextPart_000_000C_01BEECF4.302EC760 Content-Type: java/*; name="upmhttpserver.java" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="upmhttpserver.java" X-Sun-Content-Length: 29130 //##################################################################### // //##################################################################### /* import crysec.SSL.*; import crysec.*; import crysec.X509.*; */ import java.io.*; import java.net.*; import java.io.*; import java.util.*; import java.util.Date; import java.text.*; import java.lang.System; import java.util.Hashtable; import java.util.StringTokenizer; import java.net.URLEncoder; import com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection; import com.sun.net.ssl.internal.www.protocol.https.Handler; import com.sun.net.ssl.internal.www.https.HttpsClient; //##################################################################### // //##################################################################### class upmhttpserver implements HttpConstants { =20 //##################################################################### //* print to stdout */ //##################################################################### protected static void p(String s) { System.out.println(s); } //##################################################################### // //##################################################################### /* print to the log file */ protected static void log(String s) { synchronized (log) { log.println(s); log.flush(); } } //##################################################################### // //##################################################################### /* print to the html file */ protected static void htmlout(String s) { synchronized (htmlout) { htmlout.println(s); htmlout.flush(); htmlout.close(); } } //##################################################################### // //##################################################################### /* print to the html file */ protected static void numout(String s) { synchronized (numout) { numout.println(s); numout.flush(); numout.close(); } } //##################################################################### // //##################################################################### /* print to the text file */ protected static void textout(String s) { synchronized (textout) { textout.println(s); textout.flush(); textout.close(); } } //##################################################################### static PrintStream htmlout =3D null; static PrintStream textout =3D null; static PrintStream numout =3D null; static PrintStream log =3D null; /* our server's configuration information is stored * in these properties */ protected static Properties props =3D new Properties(); /* Where worker threads stand idle */ static Vector threads =3D new Vector(); /* the web server's virtual root */ static File root; /* timeout on client connections */ static int timeout =3D 0; =20 static int showreceivedpages =3D 0; static int returnredirect =3D 0; static int returnfixed =3D 0; static String validfixedfilename =3D null; static String invalidfixedfilename =3D null; static int keeplogs =3D 0; static int htmlresponse =3D 0; static int textresponse =3D 0; static int posttourl =3D 0; static int saveresult =3D 0; static String lastnumberused =3D null; static String last_used_response_num =3D null; static String htmldir =3D null; static String textdir =3D null; static String posturladdress =3D null; static String connecturl =3D null; /* max # worker threads */ static int workers =3D 100; //##################################################################### //* load httpsserver.properties from disk */ //##################################################################### static void loadProps() throws IOException { File f =3D new = File("c:\\eugene\\testhome\\servlets\\httpsserver.properties"); if (f.exists()) { InputStream is =3Dnew BufferedInputStream(new FileInputStream(f)); props.load(is); is.close(); validfixedfilename =3D = props.getProperty("validfixedfilename"); invalidfixedfilename =3D = props.getProperty("invalidfixedfilename"); posturladdress =3D props.getProperty("posturladdress"); htmldir =3D props.getProperty("htmldir"); textdir =3D props.getProperty("textdir"); connecturl =3D props.getProperty("connecturl"); last_used_response_num =3D = props.getProperty("last_used_response_num"); lastnumberused =3D props.getProperty("lastnumberused"); =20 String r =3D props.getProperty("root"); if (r !=3D null) { root =3D new File(r); } r =3D props.getProperty("timeout"); if (r !=3D null) { timeout =3D Integer.parseInt(r); } r =3D props.getProperty("workers"); if (r !=3D null) { workers =3D Integer.parseInt(r); } r =3D props.getProperty("showreceivedpages"); if (r !=3D null) { showreceivedpages =3D Integer.parseInt(r); } =20 r =3D props.getProperty("returnfixed"); if (r !=3D null) { returnfixed =3D Integer.parseInt(r); } =20 r =3D props.getProperty("returnredirect"); if (r !=3D null) { returnredirect =3D Integer.parseInt(r); } =20 r =3D props.getProperty("keeplog"); if (r !=3D null) { keeplogs =3D Integer.parseInt(r); } =20 r =3D props.getProperty("htmlresponse"); if (r !=3D null) { htmlresponse =3D Integer.parseInt(r); } =20 r =3D props.getProperty("textresponse"); if (r !=3D null) { textresponse =3D Integer.parseInt(r); } =20 if (keeplogs =3D=3D 1) { r =3D props.getProperty("log"); if (r !=3D null) { p("opening log file: " + r); log =3D new PrintStream(new BufferedOutputStream( new FileOutputStream(r))); } } else { p("logging not turned on"); } } } //##################################################################### // //##################################################################### static void printProps() { p("root=3D"+root); p("timeout=3D"+timeout); p("workers=3D"+workers); if (keeplogs =3D=3D 1) { log("root=3D"+root); log("timeout=3D"+timeout); log("workers=3D"+workers); } } //##################################################################### // //##################################################################### public static void main(String[] a) throws Exception { int port =3D 8989; if (keeplogs =3D=3D 1) { log("Listening on port : "+port); } p("Listening on port : "+port); =20 if (a.length > 0) { port =3D Integer.parseInt(a[0]); } =20 // load setup constants loadProps(); // print current setup printProps(); =20 // start worker threads for vector array assignments for (int i =3D 0; i < workers; ++i) { Worker w =3D new Worker(showreceivedpages, returnredirect, = returnfixed, validfixedfilename); (new Thread(w, "worker #"+i)).start(); threads.addElement(w); } ServerSocket ss =3D new ServerSocket(port); =20 // do until system is shutdown while (true) { // wait for a connection Socket s =3D ss.accept(); Worker w =3D null; synchronized (threads) { if (threads.isEmpty()) { Worker ws =3D new Worker(showreceivedpages, = returnredirect, returnfixed, validfixedfilename); ws.setSocket(s); (new Thread(ws, "additional worker")).start(); } else { w =3D (Worker) threads.elementAt(0); threads.removeElementAt(0); w.setSocket(s); } } } } } //##################################################################### // worker class to handle incomming http request from client //##################################################################### class Worker extends upmhttpserver implements HttpConstants, Runnable { = // open 001 final static int BUF_SIZE =3D 2048; // setup value to test for end of line character static final byte[] EOL =3D {(byte)'\r', (byte)'\n' }; = // open 001a close 001a /* buffer to use for requests */ byte[] buf; /* Socket to client we're handling */ private Socket s; Worker(int showreceivedpages, int returnredirect, int returnfixed, = String validfixedfilename) { = // open 002 this.showreceivedpages =3D showreceivedpages; this.returnredirect =3D returnredirect; this.returnfixed =3D returnfixed; this.validfixedfilename =3D validfixedfilename; =20 buf =3D new byte[BUF_SIZE]; s =3D null; = =20 } = // close 002 synchronized void setSocket(Socket s) { = // open 003 this.s =3D s; notify(); } = // close 003 public synchronized void run() { = // open 004 while(true) { = // open 005 if (s =3D=3D null) { = // open 006 /* nothing to do */ try { = // open 007 wait(); } catch (InterruptedException e) { = // close 007 open 008 /* should not happen */ continue; } = // close 008 } = // close 006 try { = // open 009 handleClient(showreceivedpages, returnredirect, = returnfixed, validfixedfilename); } catch (Exception e) { = // close 009 open 010 e.printStackTrace(); } = // close 010 /* go back in wait queue if there's fewer * than numHandler connections. */ s =3D null; Vector pool =3D upmhttpserver.threads; synchronized (pool) { = // open 011 if (pool.size() >=3D upmhttpserver.workers) { = // open 012 /* too many threads, exit this one */ return; } else { = // close 012 open 013 pool.addElement(this); } = // close 013 } = // close 011 } = // close 005 } = // close 004 =20 =20 //##################################################################### // handleClient is actually where the work takes place. This routine // gets work handed off to it from worker //##################################################################### void handleClient(int showreceivedpages, int returnredirect, int = returnfixed, String validfixedfilename) throws IOException { = // open a String verified =3D null; String posting =3D ""; String postingrequest =3D ""; InputStream is =3D new BufferedInputStream(s.getInputStream()); PrintStream ps =3D new PrintStream(s.getOutputStream()); /* only block in read for specified milliseconds before fail = with java.io.InterruptedIOException, * then abandon the connection. */ s.setSoTimeout(upmhttpserver.timeout); s.setTcpNoDelay(true); =20 // clean up buffer from previous for (int i =3D 0; i < BUF_SIZE; i++) { = // open b buf[i] =3D 0; } =20 =20 int nread =3D 0, r =3D 0; =20 outerloop: =20 while (nread < BUF_SIZE) { = // open d r =3D is.read(buf, nread, BUF_SIZE - nread); if (r =3D=3D -1) { /* EOF */ break; } int i =3D 0; nread +=3D r; for (; i < nread; i++) { if (buf[i] =3D=3D (byte)'\n' || buf[i] =3D=3D = (byte)'\r') { /* read one line */ break outerloop; } } =20 } int i =3D 0; for (i =3D 0; i < nread; i++) { = // open k if (buf[i] =3D=3D (byte)' ') { = // open l break; } = // close l } = // close k postingrequest =3D (new String(buf, 0, nread)); try { =20 // open m verified=3DConnectionServer(showreceivedpages, = postingrequest); } catch (java.lang.Exception ex) { p("Java Language Exception " + ex + "\n"); if (keeplogs =3D=3D 1) { log("Java Language Exception " + ex + "\n"); } } // close m open n close n =20 if (returnredirect =3D=3D 1) { ps.print(verified); ps.write(EOL); ps.flush(); } else { if (returnfixed =3D=3D 1) { =20 File f =3D new File(validfixedfilename); if (f.exists()) { InputStream vf =3Dnew BufferedInputStream(new = FileInputStream(f)); // convert read file to string and return try { = // open m int n; while ((n =3D vf.read(buf)) > 0) { ps.write(buf, 0, n); ps.write(EOL); ps.flush(); vf.close(); } } catch (java.lang.Exception e) {p("Java Language Exception " + = e + "\n");if (keeplogs =3D=3D 1) {log("Java Language Exception " + e + = "\n");}}=20 } } } if (keeplogs =3D=3D 1) {log(verified);} s.close(); is.close(); } = // close a =20 //##################################################################### // This routine uses the URL connection method //##################################################################### static String ConnectionServer(int showreceivedpages, String postString) = throws Exception { int lastused =3D 0; StringBuffer s =3D new StringBuffer(200); String redirect =3D ""; String firstredirect =3D null; com.sun.net.ssl.internal.www.protocol.https.Handler hnd =3D new = Handler(); // route one=09 // URL anacomURL =3D new = URL("https://www.anacom.com/order/testaccount/transaction.htm"); // URLConnection connection =3D hnd.openConnection(anacomURL);=20 // route two =20 URL anacomURL =3D new = URL("https://www.anacom.com/order/testaccount/transaction.htm"); URLConnection connection =3D new HttpsURLConnection(anacomURL, hnd); // not used // HttpsClient hc =3D new = HttpsClient(connection.getNewClient(anacomURL));=20 =09 connection.setDoOutput(true); connection.setDoInput(true); connection.setUseCaches(false); =20 connection.setRequestProperty("Content-Type", = "application/x-www-form-urlencoded"); String lengthv =3D postString.length()+" "; connection.setRequestProperty("Content-Length", lengthv); =20 DataOutputStream out =3D new = DataOutputStream(connection.getOutputStream()); if (showreceivedpages =3D=3D 1) { p(postString); } if (keeplogs =3D=3D 1) { log(postString); } out.writeBytes(postString); out.close(); =09 =20 BufferedReader in =3D new BufferedReader(new = InputStreamReader(connection.getInputStream())); String inputLine; while ((inputLine =3D in.readLine()) !=3D null) { s.append(inputLine); = } in.close(); =09 if (s.toString().toLowerCase().indexOf("result") > 0) { firstredirect =3D = s.toString().substring(s.toString().toLowerCase().indexOf("result")+8, = s.toString().toLowerCase().indexOf("")); redirect =3D firstredirect.substring(firstredirect.indexOf("

"), = firstredirect.length());=20 =20 // only allow either HTML or TEXT response file to be saved but // not both. This is for performance and security if (htmlresponse =3D=3D 1 || textresponse =3D=3D 1) { lastused =3D getnumber(); int valnum =3D savelast(lastused); =20 if (htmlresponse =3D=3D 1) { if (keeplogs =3D=3D 1) { log("HTML response output file selected!"); } int valid =3D savehtmlfile(lastused, firstredirect); }=20 if (textresponse =3D=3D 1) { int valid =3D savetextfile(lastused, redirect); } } =09 // display to screen if (showreceivedpages =3D=3D 1) { p(firstredirect); } =20 // send to log file if (keeplogs =3D=3D 1) { log(firstredirect); } } =09 return redirect; =20 } //##################################################################### // This routine uses the raw socket method of connection //##################################################################### /* static String ConnectionSocket(int showreceivedpages, String = postString) throws Exception { int lastused =3D 0; StringBuffer s =3D new StringBuffer(200); String redirect =3D ""; String firstredirect =3D null; =09 try { SSLParams params =3D new SSLParams();=09 params.setDebug(true); SSLCertificate cert =3D new SSLCertificate(); cert.certificateList =3D new Vector(); cert.certificateList.addElement(new X509(new = File("client-cert.der"))); cert.certificateList.addElement(new X509(new File("ca-cert.der"))); cert.privateKey =3D new RSAPrivateKeyPKCS8("test", new = File("enc-client-key.der")); params.setClientCert(cert); String host =3D "209.219.198.67"; int port =3D 443; SSLSocket connection =3D new SSLSocket(host, port, params); =09 if (connection.getServerCert() !=3D null) { if (connection.getServerCert().rootCAvalid()) p("Known CA"); else p("Unknown root CA " + connection.getServerCert().rootCA()); } OutputStream nos =3D connection.getOutputStream(); InputStream nis =3D connection.getInputStream(); // tell the socket they type of posting we are doing String outstr =3D "POST /order/testaccount/transaction.htm = HTTP/1.0\r\n"; nos.write(outstr.getBytes()); =20 outstr =3D "Content-Type: application/x-www-form-urlencoded\r\n"; nos.write(outstr.getBytes()); String lengthv =3D postString.length()+"\r\n"; outstr =3D "Content-Length: "+lengthv; nos.write(outstr.getBytes()); =20 if (showreceivedpages =3D=3D 1) { p(postString); } if (keeplogs =3D=3D 1) { log(postString); } nos.write(postString.getBytes()); =09 String request =3D "GET / HTTP/1.0\r\n\r\n"; nos.write(request.getBytes()); int c; while ((c =3D nis.read()) !=3D -1) { } connection.close(true); } catch (Exception e) { e.printStackTrace(); if (keeplogs =3D=3D 1) { log("Stack Trace Exception printed"); } } if (s.toString().toLowerCase().indexOf("result") > 0) { firstredirect =3D = s.toString().substring(s.toString().toLowerCase().indexOf("result")+8, = s.toString().toLowerCase().indexOf("")); redirect =3D firstredirect.substring(firstredirect.indexOf("

"), = firstredirect.length());=20 =20 // only allow either HTML or TEXT response file to be saved but // not both. This is for performance and security if (htmlresponse =3D=3D 1 || textresponse =3D=3D 1) { lastused =3D getnumber(); int valnum =3D savelast(lastused); =20 if (htmlresponse =3D=3D 1) { if (keeplogs =3D=3D 1) { log("HTML response output file selected!"); } int valid =3D savehtmlfile(lastused, firstredirect); }=20 if (textresponse =3D=3D 1) { int valid =3D savetextfile(lastused, redirect); } } =09 // display to screen if (showreceivedpages =3D=3D 1) { p(firstredirect); } =20 // send to log file if (keeplogs =3D=3D 1) { log(firstredirect); } } =09 return redirect; =20 } */ //##################################################################### // //##################################################################### static int savetextfile(int lastused, String response) { if (keeplogs =3D=3D 1) { log("TEXT response output file selected!"); } try { textout =3D new PrintStream(new BufferedOutputStream( new = FileOutputStream(textdir+lastused+".txt"))); String textfile =3D buildtextfile(response); = =20 textout(textfile); =20 } catch (java.io.IOException e) { p("Java Language IO Exception " + e + "\n"); if (keeplogs =3D=3D 1) { log("Java Language IO Exception " + e + "\n"); } }=20 return 0; } //##################################################################### // //##################################################################### static int savehtmlfile(int lastused, String s) { try { htmlout =3D new PrintStream(new BufferedOutputStream( new = FileOutputStream(htmldir+lastused+".html"))); htmlout(s); } catch (java.io.IOException e) { p("Java Language IO Exception " + e + "\n"); if (keeplogs =3D=3D 1) { log("Java Language IO Exception " + e + "\n"); } }=20 return 0; } //##################################################################### // //##################################################################### static int savelast(int lastused) { try { numout =3D new PrintStream(new BufferedOutputStream( new = FileOutputStream(last_used_response_num))); numout("lastnumberused=3D"+lastused); } catch (java.io.IOException e) { p("Java Language IO Exception " + e + "\n"); if (keeplogs =3D=3D 1) { log("Java Language IO Exception " + e + "\n"); } }=20 return 0; } //##################################################################### // //##################################################################### static int getnumber() throws java.io.IOException { int lastused =3D 0; =20 try { if (keeplogs =3D=3D 1) { log(last_used_response_num + " Read for last number used!"); } File f =3D new File(last_used_response_num); if (f.exists()) { InputStream is =3Dnew BufferedInputStream(new FileInputStream(f)); =20 props.load(is); is.close(); =20 String r =3D props.getProperty("lastnumberused"); if (r !=3D null) { lastused =3D Integer.parseInt(r); if (keeplogs =3D=3D 1) { log("Number Selected :" +lastused); } lastused++; } else {=20 if (keeplogs =3D=3D 1) { log("Invalid number format found in = "+last_used_response_num+" file number 1 selected"); } lastused =3D 1; } } else {=20 if (keeplogs =3D=3D 1) { log(last_used_response_num+" does not exist so number 1 = selected!"); } lastused =3D 1; } } catch (java.io.IOException e) { p("Java Language IOException " + e + "\n"); if (keeplogs =3D=3D 1) { log("Java Language IOException " + e + "\n"); } }=20 return lastused; } //##################################################################### // //##################################################################### static String buildtextfile(String response) { String textfile =3D "The following values were received from upm = billing system!\n"; String[] values =3D breakupresult(response); =20 int i =3D 0; =20 textfile =3D textfile + = "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D\n"; =20 for (i=3D0; i"); int tc =3D st.countTokens(); String[] s =3D new String[tc]; =20 int x =3D 0; =20 while (st.hasMoreTokens()) { s[x] =3D (st.nextToken()); x++; }=20 =20 return s; } } //##################################################################### // //##################################################################### interface HttpConstants { /** 2XX: generally "OK" */ public static final int HTTP_OK =3D 200; public static final int HTTP_CREATED =3D 201; public static final int HTTP_ACCEPTED =3D 202; public static final int HTTP_NOT_AUTHORITATIVE =3D 203; public static final int HTTP_NO_CONTENT =3D 204; public static final int HTTP_RESET =3D 205; public static final int HTTP_PARTIAL =3D 206; /** 3XX: relocation/redirect */ public static final int HTTP_MULT_CHOICE =3D 300; public static final int HTTP_MOVED_PERM =3D 301; public static final int HTTP_MOVED_TEMP =3D 302; public static final int HTTP_SEE_OTHER =3D 303; public static final int HTTP_NOT_MODIFIED =3D 304; public static final int HTTP_USE_PROXY =3D 305; /** 4XX: client error */ public static final int HTTP_BAD_REQUEST =3D 400; public static final int HTTP_UNAUTHORIZED =3D 401; public static final int HTTP_PAYMENT_REQUIRED =3D 402; public static final int HTTP_FORBIDDEN =3D 403; public static final int HTTP_NOT_FOUND =3D 404; public static final int HTTP_BAD_METHOD =3D 405; public static final int HTTP_NOT_ACCEPTABLE =3D 406; public static final int HTTP_PROXY_AUTH =3D 407; public static final int HTTP_CLIENT_TIMEOUT =3D 408; public static final int HTTP_CONFLICT =3D 409; public static final int HTTP_GONE =3D 410; public static final int HTTP_LENGTH_REQUIRED =3D 411; public static final int HTTP_PRECON_FAILED =3D 412; public static final int HTTP_ENTITY_TOO_LARGE =3D 413; public static final int HTTP_REQ_TOO_LONG =3D 414; public static final int HTTP_UNSUPPORTED_TYPE =3D 415; /** 5XX: server error */ public static final int HTTP_SERVER_ERROR =3D 500; public static final int HTTP_INTERNAL_ERROR =3D 501; public static final int HTTP_BAD_GATEWAY =3D 502; public static final int HTTP_UNAVAILABLE =3D 503; public static final int HTTP_GATEWAY_TIMEOUT =3D 504; public static final int HTTP_VERSION =3D 505; } //##################################################################### ------=_NextPart_000_000C_01BEECF4.302EC760--

Eugene Larkin

=

Phone Numbers=20

(972)=20 588-8333 Cell
(972)=20 390-6672 Work

EMail Addresses=20

mailto:eugene@systemchanges.co= m Personal
mailto:ELarkin@lyrick.com= Work

URL Addresses=20

http://www.systemchanges.com Personal
http://www.eugenelarkin.com Personal