I decided to use the simplest way and just restart the application if certificate is changed using spring actuator.
To do it we should enable restart endpoint int application.properties:
management.endpoint.restart.access=read_only
and in my ContainerConfiguration.java:
autowire RestartEndpoint
my method reloadSSLConfig now looking so:
private void reloadSSLConfig() {
restartEndpoint.restart();
}
PS: also I've found the article about hot reloading SSL in spring: SSL hot reload in Spring Boot 3.2.0