Jul 21st, 2010, 08:44 AM
Hostname verification on https request when using HttpRequestExecutor
I am using the Spring Integration (v 1.0.4) HttpRequestExecutor to invoke a service by posting data over an https connection to another server on our network.
This has resulted in an error "HTTPS hostname wrong: should be <xxxxx>" due to an issue with the certificate used. I am unable to fix the issue immediately and so was going to implement a custom hostname verification by setting the HostnameVerifier on the HttpsConnection object used.
Unfortunately this has proved to be more difficult than anticipated as the SimpleHttpRequestExecutor class I am using has all of the relevent methods declared as private meaning that I can neither override them in a sub-class nor use Spring AOP to make the change I require.
Does anyone know of a way to overcome this problem?
Thanks in advance
Tags for this Thread