Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add generic undertow client configuration #8

Open
jam01 opened this issue Aug 20, 2021 · 0 comments
Open

add generic undertow client configuration #8

jam01 opened this issue Aug 20, 2021 · 0 comments

Comments

@jam01
Copy link
Collaborator

jam01 commented Aug 20, 2021

    @Bean
    public SSLContextParameters builtin() throws GeneralSecurityException {
        TrustManagerFactory managerFactory = TrustManagerFactory
                .getInstance(TrustManagerFactory.getDefaultAlgorithm());
        managerFactory.init((KeyStore) null);

        TrustManagersParameters trustParams = new TrustManagersParameters();
        trustParams.setTrustManager(managerFactory.getTrustManagers()[0]);

        SSLContextParameters answer = new SSLContextParameters();
        answer.setTrustManagers(trustParams);

        return answer;
    }

    @Bean
    public UndertowComponent client(SSLContextParameters builtin) {
        UndertowComponent answer = new UndertowComponent();
        answer.setSslContextParameters(builtin);

        return answer;
    }

see:
https://access.redhat.com/documentation/en-us/red_hat_amq/6.3/html/security_guide/ssl-sysprops
https://gist.github.com/ravishankarhassain/51ccfbdb350f7ee57a05799655ccd94a
https://camel.apache.org/manual/latest/camel-configuration-utilities.html
https://stackoverflow.com/questions/19005318/implementing-x509trustmanager-passing-on-part-of-the-verification-to-existing/19005844#19005844
https://stackoverflow.com/questions/24555890/using-a-custom-truststore-in-java-as-well-as-the-default-one
https://stackoverflow.com/questions/31920719/getting-the-trusted-x509certificate-for-a-java-sslsocket
https://github.com/square/okhttp/blob/okhttp_4.9.x/okhttp/src/main/kotlin/okhttp3/internal/platform/Platform.kt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant