I need to refresh/restart Tomcat after adding the generated SSL certificate in keystore. I'm using Java REST call to add the certificate.
store.setKeyEntry("tomcat", keyPair.getPrivate(),
"password".toCharArray(), certs);
Refresh/restart should happen within in the same REST call.
How can I achieve this?
This is a high level security problem! You cannot / should not restart your server with a REST call! This will give your clients a very simple way to generate a DOS Denial of Service hack in your datacenter possibly restricting other services!
In case you need to manage lower level software / hardware services related to your assets then you should not use your application level services and protocols but you should implement low level management protocols which is part of your security infrastructure!
To be more specific in your case I would use a Virtual Environment e.g. VMWare and the related protocols and calls to set / reset credentials and start / restart servers dynamically! There is a good chance that the VMWare virtual services also have some upper level applications which have REST services that you can still use (after SSL handshake and all related security handles) from your client to call HTTP REST to initiate those services!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With