Updated on July 08, 2016.
I have to implement Web-service to Web-service communication over SSL. The requirement is like we have an application which runs on Eclipse Virgo server. The application comprises of few OSGI bundles. Currently when a user enters some data to store the application accepts it and persist the data to the heterogeneous data sources(Database, C process using JNI) based on the entities and this works fine.
Now what I need to achieve is like, the same application will be deployed in multiple servers and there will be an option in UI to specify the replication servers(i.e the server with same application running and the data needed to be replicated).
For this we plan to create a separate bundle to have a Restful web-service and move all the persistence logic to save the data to the heterogeneous data sources. This Rest API will check for the available replication servers and has to pass the same data with the Rest service in those servers.
The point to be noted is that, we make use of Spring Security framework to ensure security of our java application. Since we don't expose our web-services to any third party applications, all the calls including the call to web-service will be using this for authentication and authorization.
We don't do this for load balancing. Each server is independent and we install the application along with the required software using an installer application. The idea is to use the installer to create and install a Self-signed certificate. While installing the application we may not be knowing whether we need to replicate this to another server. Because not every client of this application needs a replication server. Clients who need to use replication servers must be able to enable and disable one or more replication Servers through the Java web applications admin screen at later stage. From there on what ever data manipulation occurs in one Server need to be replicated to other in a bi-directional way.
So my query is how do we get the public key dynamically and encrypt the request to connect to those replication servers in bi-directional manner since its running in SSL?
I am totally new to concept of SSL.
Thanks in advance.