'How do i get Spring Vault to trust a custom TLS chain provided as PEM

I am currently using Spring Vault with TLS, which works fine. My problem is that I need to support a custom TLS chain to connect to a client's Vault instance. Using a jks is not an option, my only option is to use PEM files.

I've read that Spring Vault is able to use PEM files for its SSL configuration, but I can't figure out how ... :(



Solution 1:[1]

Technically you need to customize underlining web client and provide custom SslConfiguration loading certificates from PEM files and creating truststore in runtime.

Looking at VaultAutoConfiguration you could provide custom ClientFactoryWrapper bean configured with your SslConfiguration.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alex