Hello folks,
I simply extended "AuthSSLProtocolSocketFactory" from
"ProtocolSocketFactory" instead of "SecureProtocolSocketFactory" and it
worked for me...
Hope this helps,
Danniel Nascimento
2006/2/25, Roland Weber <[EMAIL PROTECTED]>:
>
> Hello Sanjeev,
>
> put a little less code into a single statement or use a typecast:
>
> option 1:
>
> ProtocolSocketFactory psf = new AuthSSLProtocolSocketFactory
> (new URL("file:" + strClientKeyStore), strClientKeyStorePassword,
> new URL("file:" + strServerTrustStore), strServerTrustStorePassword);
> authhttps = new Protocol("https", psf, 443);
>
>
> option 2:
>
> authhttps = new Protocol("https",
> (ProtocolSocketFactory) new AuthSSLProtocolSocketFactory(new
> URL("file:"
> + strClientKeyStore), strClientKeyStorePassword,
> new URL("file:" + strServerTrustStore),
> strServerTrustStorePassword), 443);
>
>
> cheers,
> Roland
>
> Sanjeev Kumar Neemkar wrote:
> > Hi,
> > How to over come the deprication API problem?
> > *Protocol*<
> file:///C:/Sanjeev/commons-httpclient-3.0-rc4/docs/apidocs/org/apache/commons/httpclient/protocol/Protocol.html#Protocol(java.lang.String
> ,
> > org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory,
> int)>(
> > String <http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html>
> scheme,
> > SecureProtocolSocketFactory<
> file:///C:/Sanjeev/commons-httpclient-3.0-rc4/docs/apidocs/org/apache/commons/httpclient/protocol/SecureProtocolSocketFactory.html
> >
> > factory,
> > int defaultPort) is depricated.
> > AuthSSLProtocolSocketFactory is sub-class of
> > SecureProtocolSocketFactory<
> file:///C:/Sanjeev/commons-httpclient-3.0-rc4/docs/apidocs/org/apache/commons/httpclient/protocol/SecureProtocolSocketFactory.html
> >.
> >
> >
> > *used **AuthSSLProtocolSocketFactory located
> > at*
> http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java?view=markup
> <
> http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java?view=markup
> >
> >
> > Simirarly HttpRecoverableException is also depricated. What is the
> > alternative for it when used eith AuthSSLProtocolSocketFactory ?
> >
> > -Sanjeev
> >
> > Code snnipet below...
> > // java code used
> > public ABCCLiGet() {
> > try {
> > authhttps = new Protocol("https",
> > new AuthSSLProtocolSocketFactory(new URL("file:"
> > + strClientKeyStore), strClientKeyStorePassword,
> > new URL("file:" + strServerTrustStore),
> > strServerTrustStorePassword), 443);
> > Protocol.registerProtocol("https", authhttps);
> > } catch (Exception ex) {
> > ourLogger.error("Error while registering Protocol", ex);
> > ex.printStackTrace();
> > }
> > }
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>