Use of RestClientBuilder leads to RESTEASY004655

See original GitHub issue

Describe the bug

In my application, I use a REST client using Injection:

@Inject
@RestClient
MyApi myApi;

Which I configure using properties like:

my-api/mp-rest/url             = ${base-url}
my-api/mp-rest/connectTimeout  = 5000
my-api/mp-rest/readTimeout     = 10000

quarkus.ssl.native    = true
quarkus.tls.trust-all = true

quarkus.oidc-client.client-enabled             = true
quarkus.oidc-client-filter.register-filter     = false
quarkus.oidc-client.auth-server-url            = ${oidc-auth-server}
quarkus.oidc-client.client-id                  = ${client-id}
quarkus.oidc-client.credentials.secret         = ${client-secret}

The client is generates using the openapi generator so I don’t have much option to customize (i.e. to add additional providers) thus I want to programmatic create the client but at this point, if I do something like:

 myApi = RestClientBuilder.newBuilder()
    .baseUri(controlPlaneUri)
    .register(OidcClientRequestFilter.class)
    .register(SomethingElse.class)
    .build(MyApi.class);

then each call fails with:

javax.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Expected behavior

I should be able to create a rest client using RestClientBuilder

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.0.2

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
michalszynkiewiczcommented, Jul 21, 2021

https://github.com/quarkusio/quarkus/pull/18892

I think I amended fixes to the commit after creating the PR and that’s why it didn’t link

1reaction
michalszynkiewiczcommented, Jul 21, 2021

I will fix it, hopefully today. I have something that should work but one of the tests is failing ATM 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

[RESTEASY-1407] Client Proxy/MP-Rest-Client fails ... - Red Hat
ProcessingException: RESTEASY004655: Unable to invoke request at org.jboss.resteasy.client.jaxrs.engines. ... RestClientBuilder builder = RestClientBuilder.
Read more >
RESTEasy Client API - Baeldung
A quick guide to building out a client for the REST API using RESTEasy.
Read more >
Quarkus / Restclient with proxy configuration - Stack Overflow
I tried to use -Dhttp.proxyHost and -Dhttp.proxyPort to test the proxy and it was success. the problem is I can't use -Dparams since...
Read more >
Chapter 51. MicroProfile Rest Client - JBoss.org
The MicroProfile Client RestClientBuilder interface includes a number of methods that support the use of SSL: RestClientBuilder hostnameVerifier( ...
Read more >
2020 quarkus-fascicle-understanding-v1.pdf
on application servers (JBoss EAP, WildFly) or building reactive applications on the JVM (with. Eclipse Vert.x for example). Due to its ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found