I am trying to consume SSL secured Spring/Java Hessian Service.
Problem: No where I could find an example how can I setup SSL to pass my client certificate :(
Any help here is most appreciated.
Server Setup
- With Jetty Application am exposing Hessian service like following.
- Following "booking" Service is exposed on https://super.server/service/booking.
- Here before request reaching Java Web Application, it goes through a Web Server where the request is secured with SSL. If passed, than only its forwarded to Java Web application hosting following Hessian Service.
    @Bean(name = "/booking") 
    RemoteExporter bookingService() {
        HessianServiceExporter exporter = new HessianServiceExporter();
        exporter.setService(new CabBookingServiceImpl());
        exporter.setServiceInterface( CabBookingService.class );
        return exporter;
    }
Client Setup
- Here somehow I have to access a https URL i.e. Setup an SSL.
- I know how to do it for HttpCleint.
- I as well know internally even Hessian is using URLConnection. And I am sure there is a easier way to hook ssl in here.
    @Configuration
    public class HessianClient {
        @Bean
        public HessianProxyFactoryBean hessianInvoker() {
            HessianProxyFactoryBean invoker = new HessianProxyFactoryBean();
            invoker.setServiceUrl("https://super.server/booking");
            invoker.setServiceInterface(CabBookingService.class);
            return invoker;
        }
    }
 
                        
decided on runtimebased on System.property. Following is the sample code from HessianProxyFactory.class