Glen Nakamura wrote:
> 
> Aloha,
> 
> The following patch fixes a problem with SSL client ceritificates and
> HTTP POST data when using the Warp connector.  When Tomcat retrieves
> the SSL certificate, the getX509Certificates() method is called and
> this.packet is reset...  Now, when the read() method is called to retrieve
> the POST data, the packet type is invalid and an exception is thrown
> preventing the parameters from showing up in the request.  The quick fix
> was to make the packet variable in getX509Certificates() local, but
> maybe there should be another WarpPacket class variable that could be
> reused instead of constructing a new WarpPacket on every invocation?

I think I have fixed the problem... Could you retest it with the lastest CVS?

> I'll leave that decision to people who are more familiar with the code.
> 
> - Glen Nakamura
> 
> --- webapp-module-1.0.1-tc401/java/WarpRequest.java     Wed Oct 31 13:21:33 2001
> +++ ../webapp-module-1.0.1-tc401/java/WarpRequest.java  Fri Feb  1 14:46:53 2002
> @@ -201,8 +201,9 @@
>          public String getX509Certificates()
>          throws IOException {
>              if (closed) throw new IOException("Stream closed");
> -            this.packet.reset();
> -            this.packet.setType(Constants.TYPE_ASK_SSL_CLIENT);
> +            WarpPacket packet = new WarpPacket();
> +            packet.reset();
> +            packet.setType(Constants.TYPE_ASK_SSL_CLIENT);
>              this.request.getConnection().send(packet);
>              packet.reset();
> 
> @@ -211,7 +212,7 @@
>              if (packet.getType()==Constants.TYPE_REP_SSL_NO) return(null);
>              if (packet.getType()!=Constants.TYPE_REP_SSL_CERT)
>                 throw new IOException("Invalid WARP packet type for CC");
> -            return(this.packet.readString());
> +            return(packet.readString());
>          }
> 
>          /** Read the data from the SSL environment. */
> @@ -219,8 +220,9 @@
>          throws IOException {
> 
>              if (closed) throw new IOException("Stream closed");
> -            this.packet.reset();
> -            this.packet.setType(Constants.TYPE_ASK_SSL);
> +            WarpPacket packet = new WarpPacket();
> +            packet.reset();
> +            packet.setType(Constants.TYPE_ASK_SSL);
>              this.request.getConnection().send(packet);
>              packet.reset();
> 
> @@ -230,9 +232,9 @@
>              if (packet.getType()!=Constants.TYPE_REP_SSL)
>                 throw new IOException("Invalid WARP packet type for SSL data");
>              WarpSSLData ssldata  = new WarpSSLData();
> -            ssldata.ciph = this.packet.readString();
> -            ssldata.sess = this.packet.readString();
> -            ssldata.size = this.packet.readInteger();
> +            ssldata.ciph = packet.readString();
> +            ssldata.sess = packet.readString();
> +            ssldata.size = packet.readInteger();
>              return(ssldata);
>          }
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to