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

RestClientSsl is not provided as a bean #37400

Closed
mhalbritter opened this issue Sep 15, 2023 · 0 comments
Closed

RestClientSsl is not provided as a bean #37400

mhalbritter opened this issue Sep 15, 2023 · 0 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@mhalbritter
Copy link
Contributor

The documentation states that RestClientSsl can be injected to customize a RestClient: https://docs.spring.io/spring-boot/docs/3.2.0-SNAPSHOT/reference/htmlsingle/#io.rest-client.restclient.ssl

However, when using this code:

@Service
public class MyService {

    private final RestClient restClient;

    public MyService(RestClient.Builder restClientBuilder, RestClientSsl ssl) {
        this.restClient = restClientBuilder.baseUrl("https://example.org").apply(ssl.fromBundle("mybundle")).build();
    }

}

this fails with:

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 1 of constructor in com.example.restclientcustomizer.MyService required a bean of type 'org.springframework.boot.autoconfigure.web.client.RestClientSsl' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.boot.autoconfigure.web.client.RestClientSsl' in your configuration.

There's an implementation named AutoConfiguredRestClientSsl in our codebase, but it is not provided as a bean.

@mhalbritter mhalbritter added the type: bug A general bug label Sep 15, 2023
@mhalbritter mhalbritter added this to the 3.2.x milestone Sep 15, 2023
@mhalbritter mhalbritter self-assigned this Sep 15, 2023
@mhalbritter mhalbritter modified the milestones: 3.2.x, 3.2.0-M3 Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant