Class RestClientSslContextAliasListener

  • All Implemented Interfaces:
    org.eclipse.microprofile.rest.client.spi.RestClientListener

    public class RestClientSslContextAliasListener
    extends Object
    implements org.eclipse.microprofile.rest.client.spi.RestClientListener
    This class implements RestClientListener to evaluate the alias property and set a custom sslContext for the MicroProfile rest client
    • Constructor Detail

      • RestClientSslContextAliasListener

        public RestClientSslContextAliasListener()
    • Method Detail

      • onNewClient

        public void onNewClient​(Class<?> serviceInterface,
                                org.eclipse.microprofile.rest.client.RestClientBuilder restClientBuilder)
        Specified by:
        onNewClient in interface org.eclipse.microprofile.rest.client.spi.RestClientListener
      • buildSSlContext

        protected SSLContext buildSSlContext​(String alias)
        This method evaluate the alias on the global keystore and return the corresponding SSLContext based on the alias if not available the SSLContext should be the default that Jersey implementation set
        Parameters:
        alias - name of the certificate
        Returns:
        the SSLContext with the corresponding certificate and alias name
      • getConfig

        protected org.eclipse.microprofile.config.Config getConfig()
        Method to get the config
        Returns:
        Config from MicroProfile
      • getKeyManagers

        protected KeyManager[] getKeyManagers()
                                       throws Exception
        Method used to get KeyManagers
        Returns:
        an array of KeyManager
        Throws:
        Exception
      • getKeyStores

        protected KeyStore[] getKeyStores()
                                   throws IOException
        Method used to get KeyStores
        Returns:
        an array of KeyStore
        Throws:
        IOException