Skip to content

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

Closed
@spring-projects-issues

Description

@spring-projects-issues

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions