On Tue, 2005-12-27 at 23:03 +0530, Nishant Agrawal wrote: > Hi, > > > > I need to send XML over HTTP. > > Things like mode (BasicAuthentication / SSL), keystore, truststore and > all associated credentials can be configurable at runtime using JMX. > > > > What I want is to persist connections( for a given configuration) using > MultiThreadedConnectionManager. >
The MTHCM pools connections based on HostConfiguration (a combination of host, port, protocol scheme, local address, proxy host, proxy port). HTTP connections are stateless, that is, they hold no user specific state. HTTPS connections may be user specific if the certificate based SSL client authentication is employed. HttpClient does not support pooling of such connections. The only way to work this limitation around is to associate each unique keystore with a untique protocol scheme myHTTPS1 = new Protocol("https", customSSLSocketFac1, port); myHTTPS2 = new Protocol("https", customSSLSocketFac2, port); Protocol.registerProtocol("myhttps1", myHTTPS1); Protocol.registerProtocol("myhttps2", myHTTPS2); hostConfig.setHost(myhost, port, "myhttps1"); hostConfig.setHost(myhost, port, "myhttps2"); > If the configuration changes, a new connection should be persisted to > pool. > > > > I intend to create a custom SSLConnectionFactory and set it to config as > follows: > > myHTTPS = new Protocol("https", customSSLSocketFac, port) > > hostConfig.setHost(myURL, port, myHTTPS); > > > > This will save me time, otherwise lost in handshaking for each post. > > How can I also persist connections to some pool based on credentials / > authScope ? > Pooling connections based on credentials / authScope does not make much sense in my opinion. All HTTP authentication schemes supported by HttpClient per default (Basic, Digest, and to an extend NTLM) carry auth challenges / responses in HTTP headers and can work with any arbitrary connection with the same HostConfiguration The SSL client authentication is a whole different story (see above) Hope this helps Oleg > > > Thanks in advance. > > > > Regards, > > Nishant > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]