Michael, what is the value of servletPath?
Oleg
On Fri, Jul 29, 2005 at 08:46:21AM -0400, Michael Clovis wrote:
>
> Oleg thanks in advance..
>
> This is from the class that extends HttpClient.. all methods prepare servlet
> request first like so..
>
>
> public boolean authorizeIS(){
> NameValuePair[] form_data = new NameValuePair[8];
> form_data[0] = new NameValuePair("sourceid", SOURCE_ID);
> //APPLICATION ID
> form_data[1] = new NameValuePair("destid", DEST_ID);
> //DEST ID
> form_data[2] = new
> NameValuePair("requesttype",BULKLOADERSESSIONID_REQ); //TYPE OF REQUEST
> form_data[3] = new NameValuePair("requestid", "111");
> //ID OF THE REQUEST
> form_data[4] = new NameValuePair("username",isUser);
> //USER ID
> form_data[5] = new NameValuePair("password",isPass);
> //PASSWORD
> form_data[6] = new
> NameValuePair("sent",Long.toString(System.currentTimeMillis()));
> form_data[7] = new NameValuePair("ntlmlogin",ntlmlogin);
>
> StringBuffer servBuff = new StringBuffer(servletPath);
>
> servBuff.append("?sourceid=").append(SOURCE_ID).append("&destid=").append(DEST_ID);
> //System.out.println(servBuff.toString());
>
> ReqResult reqRes = this.sendRequest(servBuff.toString(),
> form_data, "Session");
> if(reqRes == null){
> System.out.println("Requested Result is null");
> //writeErrLog("Request Result was null", SERVLET_ERR);
> return false;
> }
>
> System.out.println("Request result: " + reqRes.isAccepted());
>
> if(reqRes.isAccepted()){
> this.sessionID = reqRes.getSessionId();
> this.isAdmin = reqRes.isAdmin();
> System.out.println("SESSION ID: " + this.sessionID);
> System.out.println("UserAdmin: "+isAdmin);
> }else{
>
> writeErrLog(reqRes.getErrorMessage(),Integer.parseInt(reqRes.getErrorCode()));
> return false;
> }
>
> return true;
> }
>
> ... sendRequest is where PostMethod is executed as follows...
>
>
> protected ReqResult sendRequest(String host, NameValuePair[] data, String
> resultType){
> PostMethod post = new PostMethod(host);
> post.addParameters(data);
> try {
> return sendRequest(post, resultType);
> } catch (Exception e) {
> this.writeErrException(e);
> e.printStackTrace();
> //throw e;
> return null;
> }
>
> }
>
> protected ReqResult sendRequest(ExpectContinueMethod post, String
> resultType){
> ReqResult reqResult = null;
> post.setDoAuthentication(true);
> try{
> this.executeMethod(post);
>
> //handle any errors that'll come down the pipe
> if(post.getStatusCode() >= 300){
>
> writeErrLog(post.getStatusLine().getReasonPhrase(), post.getStatusCode());
> return null;
> }
>
> String responseBody = new
> String(post.getResponseBodyAsString());
> System.out.println(responseBody);
> reqResult = new ReqResult(responseBody, resultType);
>
> }catch(HttpException hte){
> this.writeErrException(hte);
> hte.printStackTrace();
> }catch(IOException ioe){
> this.writeErrException(ioe);
> ioe.printStackTrace();
> }
> catch(Exception e){
> this.writeErrException(e);
> e.printStackTrace();
> }
> return reqResult;
> }
>
> I again appreciate in advance your insight!
>
>
> ---------- Original Message ----------
> Date: 7/29/05
> From: Oleg Kalnichevski <[EMAIL PROTECTED]>
> To: [email protected]
> Subject: Re: SSL with Certificate
>
> >Michael,
> >
> >Could you please post a code snippet showing how the HttpMethod is
> >instantiated and executed?
> >
> >Oleg
> >
> >
> >On Thu, Jul 28, 2005 at 05:52:30PM -0400, Michael Clovis wrote:
> >> I am maintaining an application that is using HTTPClient 2.0.2 and one
> >> clas=
> >> s extends HttpClient in particular ( one reason for not upgrading to 3x).
> >> N=
> >> eed to support SSL and have started to test code using self-signed certs.
> >> M=
> >> ade sure through Apache the servlet the application accesses can not be
> >> acc=
> >> essed other than through SSL and wire info reads that the header
> >> informatio=
> >> n can be seen yet when method is sent to servlet get a 401. Furthermore
> >> doi=
> >> ng tcpdumps reveal app never ran on port 443 but port 80. Am using simple
> >> p=
> >> aradigm (as in example code) of :
> >>
> >> StrictSSLProtocolSocketFactory sf =3D new StrictSSLProtocolSocketFactory()=
> >> ;
> >> =20
> >>
> >> Protocol stricthttps =3D new Protocol( "https", sf, 443);
> >> Protocol.registerProtocol("https",stricthttps);
> >> // du is client instance
> >> du.getHostConfiguration().setHost(this.hostname.ge=
> >> tText().trim(),443,stricthttps)
> >>
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]