jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Nielsen <gl...@voyager.apg.more.net>
Subject Re: cvs commit: jakarta-taglibs/scrape/src/org/apache/taglibs/scrape HttpConnection.java
Date Fri, 03 May 2002 16:33:43 GMT
The nightly build is working, just the GUMP build is broken
because the dependency for using JSSE has not been added to it.

Regards,

Glenn

catlett@apache.org wrote:
> 
> catlett     02/05/03 09:14:24
> 
>   Modified:    scrape/src/org/apache/taglibs/scrape HttpConnection.java
>   Log:
>   fixing the taglibs build which apparently does not have the jsse jar files available
so the code that uses that is commented out it is not ready for release
> 
>   Revision  Changes    Path
>   1.6       +33 -26    jakarta-taglibs/scrape/src/org/apache/taglibs/scrape/HttpConnection.java
> 
>   Index: HttpConnection.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-taglibs/scrape/src/org/apache/taglibs/scrape/HttpConnection.java,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- HttpConnection.java       30 Apr 2002 21:53:18 -0000      1.5
>   +++ HttpConnection.java       3 May 2002 16:14:24 -0000       1.6
>   @@ -1,7 +1,7 @@
>    /*
>   - * $Header: /home/cvs/jakarta-taglibs/scrape/src/org/apache/taglibs/scrape/HttpConnection.java,v
1.5 2002/04/30 21:53:18 catlett Exp $
>   - * $Revision: 1.5 $
>   - * $Date: 2002/04/30 21:53:18 $
>   + * $Header: /home/cvs/jakarta-taglibs/scrape/src/org/apache/taglibs/scrape/HttpConnection.java,v
1.6 2002/05/03 16:14:24 catlett Exp $
>   + * $Revision: 1.6 $
>   + * $Date: 2002/05/03 16:14:24 $
>     *
>     * ====================================================================
>     *
>   @@ -66,13 +66,12 @@
>    import java.util.*;
>    import java.security.KeyStore;
>    import javax.servlet.jsp.PageContext;
>   -import javax.net.ssl.SSLSocket;
>   -//import javax.net.ssl.SSLContext;
>   -import com.sun.net.ssl.SSLContext;
>   -import com.sun.net.ssl.KeyManagerFactory;
>   -import javax.net.ssl.SSLSocketFactory;
>   -import javax.net.ssl.HandshakeCompletedEvent;
>   -import javax.net.ssl.HandshakeCompletedListener;
>   +//import javax.net.ssl.SSLSocket;
>   +//import com.sun.net.ssl.SSLContext;
>   +//import com.sun.net.ssl.KeyManagerFactory;
>   +//import javax.net.ssl.SSLSocketFactory;
>   +//import javax.net.ssl.HandshakeCompletedEvent;
>   +//import javax.net.ssl.HandshakeCompletedListener;
> 
>    /**
>     * HttpConnection - the class that creates the http connection that the rest of the
>   @@ -149,7 +148,7 @@
>        /**
>         * the password to the client keystore for ssl authentication
>         */
>   -    private String sslclientpass = null;
>   +    private String sslpass = null;
>        /**
>         * response code from the request
>         */
>   @@ -179,9 +178,10 @@
>         *
>         */
>        public HttpConnection(URL url, PageContext pc) {
>   -     //public HttpConnection(URL url, boolean secure, PageContext pc) {
>   +    //public HttpConnection(URL url, boolean secure, String pass, PageContext pc)
{
>         this.url = url;
>         //ssl = secure;
>   +     //sslpass = pass;
>         pageContext = pc;
>        }
> 
>   @@ -199,14 +199,15 @@
>         *
>         */
>        public HttpConnection(URL url, int port, String server, String authstring,
>   -      PageContext pc) {
>   +    PageContext pc) {
>         //public HttpConnection(URL url, int port, String server, boolean secure,
>   -     //String authstring, PageContext pc) {
>   +     //String pass, String authstring, PageContext pc) {
>            this.url = url;
>            pport = port;
>            pserver = server;
>            useproxy = true;
>         //ssl = secure;
>   +     //sslpass = pass;
>         pageContext = pc;
>         if (authstring != null)
>             auth = "Basic " +
>   @@ -364,8 +365,12 @@
>         *
>         */
>        public void sendRequest() throws IOException {
>   -     // send request to the server via http
>   -     if (useproxy) {
>   +     System.out.println("sendRequest() useproxy = " + useproxy + "\n" +
>   +                     getRequestMethod() + " " + url.toString() + " HTTP/1.1\r\n");
>   +     // send request to the server via http check for not ssl because if a proxy
>   +     // and ssl are in use the request is to be tunneled through the proxy
>   +     // connection and is already setup
>   +     if (useproxy && !ssl) {
>             send(out, getRequestMethod() + " " + url.toString() + " HTTP/1.1\r\n");
>             if (auth != null)
>                 send(out, "Proxy-Authorization: " + auth + "\r\n");
>   @@ -412,8 +417,8 @@
>         *
>         */
>        boolean makeTunnelConnection() throws IOException {
>   -     //System.out.println("sending CONNECT to proxy  CONNECT " + url.getHost() +
>   -     //":" + port + " HTTP/1.1");
>   +     System.out.println("makeTunnelConnection() sending CONNECT to proxy CONNECT "
>   +                        + url.getHost() + ":" + port + " HTTP/1.1");
> 
>         // create socket to the proxy server
>         InetAddress proxy = InetAddress.getByName(pserver);
>   @@ -450,9 +455,9 @@
>         *
>         * @throws IOException
>         *
>   -     */
>   +     *
>        private void makeSecureConnection() throws IOException {
>   -     //System.out.println("makeSecureConnection()");
>   +     System.out.println("makeSecureConnection()");
>         if (useproxy) {
>             // going to tunnel the ssl connection through the proxy
>             if (!makeTunnelConnection()) {
>   @@ -467,13 +472,15 @@
>             SSLContext context = SSLContext.getInstance("TLS");
>             // if client authorization is required for the ssl connection init the
>             // SSLContext with the clients keystore
>   -         if (sslclientpass != null) {
>   +         if (sslpass != null) {
>   +             System.out.println("using client authentication for ssl");
>                 KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
>                 FileInputStream filein =
>                  new FileInputStream(System.getProperty("javax.net.ssl.trustStore"));
>                 KeyStore ks = KeyStore.getInstance("JKS");
>                 ks.load((InputStream)filein, null);
>   -             char[] password = sslclientpass.toCharArray();
>   +             System.out.println("password = " + sslpass);
>   +             char[] password = sslpass.toCharArray();
>                 kmf.init(ks, password);
>                 context.init(kmf.getKeyManagers(), null, null);
>                    sslfactory = context.getSocketFactory();
>   @@ -494,13 +501,13 @@
>             throw new IOException("HttpConnection.connect(): " +
>                                 "creating tunneled sslsocket " + nsae.toString());
>         }
>   -     //System.out.println("starting sslhandshake");
>   +     System.out.println("starting sslhandshake");
>         sslsocket.startHandshake();
>         socket = sslsocket;
>         out = sslsocket.getOutputStream();
>   -     //System.out.println("makeSecureConnection() DONE");
>   +     System.out.println("makeSecureConnection() DONE");
>        }
>   -
>   +    */
>        /**
>         * Override default provided in URLConnection
>         *
>   @@ -733,7 +740,7 @@
>                }
>                c = in.read();
>            }
>   -     //System.out.println("The results of the read = " + result);
>   +     System.out.println("The results of the read = " + result);
>            return result;
>        }
>    }
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>

-- 
----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message