hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Clovis <mclo...@mindbridge.com>
Subject SSL with Certificate
Date Thu, 28 Jul 2005 21:52:30 GMT
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)

Finally here is the "wire" output:


0 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - Java =
version: 1.4.2_02
20 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - Java=
 vendor: Sun Microsystems Inc.
20 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - Java=
 class path: D:\J2EE1.4SDK\jdk\jre\lib\charsets.jar;D:\J2EE1.4SDK\jdk\jre\l=
ib\jce.jar;D:\J2EE1.4SDK\jdk\jre\lib\jsse.jar;D:\J2EE1.4SDK\jdk\jre\lib\plu=
gin.jar;D:\J2EE1.4SDK\jdk\jre\lib\plugin_g.jar;D:\J2EE1.4SDK\jdk\jre\lib\rt=
.jar;D:\J2EE1.4SDK\jdk\jre\lib\sunrsasign.jar;D:\J2EE1.4SDK\jdk\jre\lib\ext=
\dnsns.jar;D:\J2EE1.4SDK\jdk\jre\lib\ext\ldapsec.jar;D:\J2EE1.4SDK\jdk\jre\=
lib\ext\localedata.jar;D:\J2EE1.4SDK\jdk\jre\lib\ext\sunjce_provider.jar;D:=
\J2EE1.4SDK\jdk\lib\activation.jar;D:\J2EE1.4SDK\jdk\lib\admin-cli.jar;D:\J=
2EE1.4SDK\jdk\lib\appserv-admin.jar;D:\J2EE1.4SDK\jdk\lib\appserv-assemblyt=
ool.jar;D:\J2EE1.4SDK\jdk\lib\appserv-cmp.jar;D:\J2EE1.4SDK\jdk\lib\appserv=
-ext.jar;D:\J2EE1.4SDK\jdk\lib\appserv-jstl.jar;D:\J2EE1.4SDK\jdk\lib\appse=
rv-rt.jar;D:\J2EE1.4SDK\jdk\lib\appserv-tags.jar;D:\J2EE1.4SDK\jdk\lib\apps=
erv-upgrade.jar;D:\J2EE1.4SDK\jdk\lib\commons-launcher.jar;D:\J2EE1.4SDK\jd=
k\lib\commons-logging.jar;D:\J2EE1.4SDK\jdk\lib\deployhelp.jar;D:\J2EE1.4SD=
K\jdk\lib\dt.jar;D:\J2EE1.4SDK\jdk\lib\htmlconverter.jar;D:\J2EE1.4SDK\jdk\=
lib\htmlconverter_g.jar;D:\J2EE1.4SDK\jdk\lib\j2ee-svc.jar;D:\J2EE1.4SDK\jd=
k\lib\j2ee.jar;D:\J2EE1.4SDK\jdk\lib\jax-qname.jar;D:\J2EE1.4SDK\jdk\lib\ja=
xr-api.jar;D:\J2EE1.4SDK\jdk\lib\jaxr-impl.jar;D:\J2EE1.4SDK\jdk\lib\jaxrpc=
-api.jar;D:\J2EE1.4SDK\jdk\lib\jaxrpc-impl.jar;D:\J2EE1.4SDK\jdk\lib\jhall.=
jar;D:\J2EE1.4SDK\jdk\lib\mail.jar;D:\J2EE1.4SDK\jdk\lib\relaxngDatatype.ja=
r;D:\J2EE1.4SDK\jdk\lib\saaj-api.jar;D:\J2EE1.4SDK\jdk\lib\saaj-impl.jar;D:=
\J2EE1.4SDK\jdk\lib\sun-appserv-ant.jar;D:\J2EE1.4SDK\jdk\lib\tools.jar;D:\=
J2EE1.4SDK\jdk\lib\xsdlib.jar;D:\J2EE1.4SDK\lib\endorsed\dom.jar;D:\J2EE1.4=
SDK\lib\endorsed\servlet-api.jar;D:\J2EE1.4SDK\lib\endorsed\servlet.jar;D:\=
J2EE1.4SDK\lib\endorsed\xalan.jar;D:\J2EE1.4SDK\lib\endorsed\xercesImpl.jar=
;F:\CvsCheckOut\ISDocLoader2\bin;F:\CvsCheckOut\ISDocLoader2\lib\commons-lo=
gging.jar;F:\CvsCheckOut\ISDocLoader2\lib\jdom.jar;F:\CvsCheckOut\ISDocLoad=
er2\lib\one-jar-boot-0.95.jar;F:\CvsCheckOut\ISDocLoader2\lib\IntraSmartAPI=
.jar;F:\CvsCheckOut\ISDocLoader2\lib\log4j-1.2.8.jar;F:\CvsCheckOut\ISDocLo=
ader2\lib\commons-httpclient-2.0.2.jar;F:\IntelliJ-IDEA-4.5\lib\idea_rt.jar
20 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - Oper=
ating system name: Windows NT
30 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - Oper=
ating system architecture: x86
30 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - Oper=
ating system version: 4.0
2684 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - SU=
N 1.42: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests;=
 SecureRandom; X.509 certificates; JKS keystore; PKIX CertPathValidator; PK=
IX CertPathBuilder; LDAP, Collection CertStores)
2684 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - Su=
nJSSE 1.42: Sun JSSE provider(implements RSA Signatures, PKCS12, SunX509 ke=
y/trust factories, SSLv3, TLSv1)
2684 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - Su=
nRsaSign 1.42: SUN's provider for RSA signatures
2684 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - Su=
nJCE 1.42: SunJCE Provider (implements DES, Triple DES, AES, Blowfish, PBE,=
 Diffie-Hellman, HMAC-MD5, HMAC-SHA1)
2694 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - Su=
nJGSS 1.0: Sun (Kerberos v5)
2734 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpState - ent=
er HttpState.setCredentials(String realm, String host, Credentials credenti=
als)
2965 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.GetMeth=
od - enter GetMethod(String)
2975 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.PostMet=
hod - enter PostMethod.addParameters(NameValuePair[])
2975 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.EntityE=
nclosingMethod - enter EntityEnclosingMethod.clearRequestBody()
2975 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - en=
ter HttpClient.executeMethod(HttpMethod)
2975 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpClient - en=
ter HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)
3005 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.open()
3005 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- HttpConnection.setSoTimeout(0)
3005 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.execute(HttpState, HttpConnection)
3005 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- Execute loop try 1
3005 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.processRequest(HttpState, HttpConnection)
3005 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- Attempt number 1 to process request
3005 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.writeRequest(HttpState, HttpConnection)
3015 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.writeRequestLine(HttpState, HttpConnection)
3015 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.generateRequestLine(HttpConnection, String, String, =
String, String)
3015 [AWT-EventQueue-0] DEBUG httpclient.wire.header - >> "POST /IS/ISUploa=
dServer?sourceid=3DISULD&destid=3DISUS HTTP/1.1[\r][\n]"
3015 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.print(String)
3025 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.write(byte[])
3025 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.write(byte[], int, int)
3025 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection)
3025 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.ExpectC=
ontinueMethod - enter ExpectContinueMethod.addRequestHeaders(HttpState, Htt=
pConnection)
3025 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.addRequestHeaders(HttpState, HttpConnection)
3025 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.addUserAgentRequestHeaders(HttpState, HttpConnection=
)
3025 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection)
3025 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- Adding Host request header
3025 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection)
3045 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpState - ent=
er HttpState.getCookies()
3045 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.cookie.CookieSp=
ec - enter CookieSpecBase.match(String, int, String, boolean, Cookie[])
3045 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.addAuthorizationRequestHeader(HttpState, HttpConnect=
ion)
3045 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.addProxyAuthorizationRequestHeader(HttpState, HttpCo=
nnection)
3045 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.addProxyConnectionHeader(HttpState, HttpConnection)
3045 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.EntityE=
nclosingMethod - enter HttpMethodBase.addContentLengthRequestHeader(HttpSta=
te, HttpConnection)
3045 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.EntityE=
nclosingMethod - enter EntityEnclosingMethod.getRequestContentLength()
3045 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.PostMet=
hod - enter PostMethod.hasRequestContent()
3045 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.PostMet=
hod - enter PostMethod.renerateRequestBody()
3045 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.PostMet=
hod - enter PostMethod.getParameters()
3045 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter getContentCharSet( Header contentheader )
3045 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- Default charset used: ISO-8859-1
3055 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- HttpMethodBase.addRequestHeader(Header)
3065 [AWT-EventQueue-0] DEBUG httpclient.wire.header - >> "User-Agent: Jaka=
rta Commons-HttpClient/2.0.2[\r][\n]"
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.print(String)
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.write(byte[])
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.write(byte[], int, int)
3065 [AWT-EventQueue-0] DEBUG httpclient.wire.header - >> "Host: 192.168.45=
.114[\r][\n]"
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.print(String)
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.write(byte[])
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.write(byte[], int, int)
3065 [AWT-EventQueue-0] DEBUG httpclient.wire.header - >> "Content-Length: =
79[\r][\n]"
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.print(String)
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.write(byte[])
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.write(byte[], int, int)
3065 [AWT-EventQueue-0] DEBUG httpclient.wire.header - >> "Content-Type: ap=
plication/x-www-form-urlencoded[\r][\n]"
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.print(String)
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.write(byte[])
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.write(byte[], int, int)
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.writeLine()
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.write(byte[])
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.write(byte[], int, int)
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.flushRequestOutputStream()
3065 [AWT-EventQueue-0] DEBUG httpclient.wire.header - >> "[\r][\n]"
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.EntityE=
nclosingMethod - enter EntityEnclosingMethod.writeRequestBody(HttpState, Ht=
tpConnection)
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.PostMet=
hod - enter PostMethod.hasRequestContent()
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.EntityE=
nclosingMethod - enter EntityEnclosingMethod.getRequestContentLength()
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.PostMet=
hod - enter PostMethod.hasRequestContent()
3065 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.EntityE=
nclosingMethod - Using buffered request body
3075 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.getRequestOutputStream()
3075 [AWT-EventQueue-0] DEBUG httpclient.wire.content - >> "sourceid=3DISUL=
D&destid=3DISUS&requesttype=3DVERSION&requestid=3D111&sent=3D1122582447409"
3075 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.EntityE=
nclosingMethod - Request body sent
3075 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.flushRequestOutputStream()
3075 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.readResponse(HttpState, HttpConnection)
3075 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.readStatusLine(HttpState, HttpConnection)
3075 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.readLine()
3075 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HttpParser.readLine()
3075 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HttpParser.readRawLine()
3115 [AWT-EventQueue-0] DEBUG httpclient.wire.header - << "HTTP/1.1 403 For=
bidden[\r][\n]"
3115 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.readResponseHeaders(HttpState,HttpConnection)
3115 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.getResponseInputStream()
3115 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HeaderParser.parseHeaders(HttpConnection, HeaderGroup)
3115 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HttpParser.readLine()
3115 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HttpParser.readRawLine()
3115 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HttpParser.readLine()
3115 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HttpParser.readRawLine()
3115 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HttpParser.readLine()
3115 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HttpParser.readRawLine()
3115 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HttpParser.readLine()
3115 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HttpParser.readRawLine()
3115 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HttpParser.readLine()
3125 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpParser - en=
ter HttpParser.readRawLine()
3125 [AWT-EventQueue-0] DEBUG httpclient.wire.header - << "Date: Thu, 28 Ju=
l 2005 20:19:52 GMT[\r][\n]"
3145 [AWT-EventQueue-0] DEBUG httpclient.wire.header - << "Server: Apache/2=
.0.52 (Unix) mod_ssl/2.0.52 OpenSSL/0.9.7e mod_jk/1.2.6[\r][\n]"
3145 [AWT-EventQueue-0] DEBUG httpclient.wire.header - << "Content-Length: =
340[\r][\n]"
3155 [AWT-EventQueue-0] DEBUG httpclient.wire.header - << "Content-Type: te=
xt/html; charset=3Diso-8859-1[\r][\n]"
3155 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.processResponseHeaders(HttpState, HttpConnection)
3155 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.methods.GetMeth=
od - enter GetMethod.readResponseBody(HttpState, HttpConnection)
3155 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.readResponseBody(HttpState, HttpConnection)
3155 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpMethodBase =
- enter HttpMethodBase.readResponseBody(HttpConnection)
3155 [AWT-EventQueue-0] DEBUG org.apache.commons.httpclient.HttpConnection =
- enter HttpConnection.getResponseInputStream()
Version =3D REQUST FAILED

Any help in advance would be appreciated. Have read tutorials and code exam=
ples..

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message