Skip to content

Create a Ssl Rest Client using SslContext and HostnameVerifier [DATAES-673] #1247

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

Closed
spring-projects-issues opened this issue Oct 22, 2019 · 0 comments
Labels
in: core Issues in core support type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

Henrique Eduardo do Amaral opened DATAES-673 and commented

When we create a Rest Client, we could add the possibility to set the HostnameVerifier.

Example in the class RestClients we could have:

 

Optional<SSLContext> sslContext = clientConfiguration.getSslContext();
Optional<HostnameVerifier> hostNameVerifier = clientConfiguration.getHostNameVerifier(); //new get
sslContext.ifPresent(clientBuilder::setSSLContext);
hostNameVerifier.ifPresent(clientBuilder::setSSLHostnameVerifier); //new set

 

And when we build the config, we could have something like this:

ClientConfiguration.builder().connectedTo("host1", "host2")
    .usingSsl(sslContext, NoopHostnameVerifier.INSTANCE) //new implementantion
    .withBasicAuth("user", "password")

Affects: 3.2 GA (Moore)

Referenced from: pull request #334

Backported to: 3.2.1 (Moore SR1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant