Hello Dhanushka,

>     while (retry <= retryCount) {
> 
>       try {
> 
>         Protocol authhttps = new Protocol("https",
>                                           new AuthSSLProtocolSocketFactory(
>             new URL(
>  
> "file:E:\\Dhanushka\\Connectors\\AptiloConnector_new\\my.keyStore"),

That is a really strange format for a URL. I would have used
file:///e:/Dhanushka/Connectors/AptiloConnector_new/my.keyStore
Anyway, if it works.

>             "112233",
>             new URL(
>  
> "file:E:\\Dhanushka\\Connectors\\AptiloConnector_new\\my.keyStore"),
>             "112233"), 443);
> //        httpclient.getHostConfiguration().setHost("localhost", 443,
> authhttps);
>         Protocol.registerProtocol("https", authhttps);

It is a rather bad idea to register the protocol in a loop.
And it may not work as expected, depending on how the
AuthSSLProtocolSocketFactory relates to SSL contexts.
I can't tell you details, because I don't know them.
But this _feels_ all wrong.
Use one single AuthSSLProtocolSocketFactory. Modify the
code of that factory so you can update the key store at
runtime. Test and debug until you are sure that the new
key store content is picked up at runtime.
Then verify that the initial key store is read from the
file referenced above. Afterwards, verify that updates
to the key store are written to that very file. And make
sure that the writing succeeds and is not prevented by
some spurious file locks because a file is not properly
closed or some such interference.

good luck,
  Roland


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

Reply via email to