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

Quarkus Rest Client MTLS configuration guide #40623

Open
leaqui opened this issue May 14, 2024 · 14 comments
Open

Quarkus Rest Client MTLS configuration guide #40623

leaqui opened this issue May 14, 2024 · 14 comments
Labels

Comments

@leaqui
Copy link
Contributor

leaqui commented May 14, 2024

Describe the bug

The documentation for setting up MTLS on REST clients disappeared from rest client guide at https://es.quarkus.io/version/main/guides/rest-client.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

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

No response

Additional information

https://stackoverflow.com/questions/78460678/quarkus-rest-client-mtls-configuration-guide

@leaqui leaqui added the kind/bug Something isn't working label May 14, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented May 14, 2024

/cc @cescoffier (rest-client), @geoand (rest-client), @radcortez (config)

@cescoffier
Copy link
Member

The configuration is likely going to change (the current one will still be working) following the TLS config centralization work.

@leaqui
Copy link
Contributor Author

leaqui commented May 14, 2024

Hi @cescoffier

But where is the current doc?

@mschorsch
Copy link

@leaqui
Copy link
Contributor Author

leaqui commented May 14, 2024

but this is for client-side?

@mschorsch
Copy link

You are right, my fault.

@mschorsch
Copy link

The only documentation I have found is in the MicroProfile Rest Client documentation.

Should probably be configured as follows (#22293 (comment) and https://quarkus.io/blog/quarkus-mutual-tls/#configure-microprofile-rest-client-for-mutual-tls):

# truststore config
org.acme.client.mtls.GreetingService/mp-rest/trustStore=classpath:/META-INF/resources/client.truststore.p12
org.acme.client.mtls.GreetingService/mp-rest/trustStoreType=PKCS12 # or JKS
org.acme.client.mtls.GreetingService/mp-rest/trustStorePassword=password

# keystore config
org.acme.client.mtls.GreetingService/mp-rest/keyStore=classpath:/META-INF/resources/client.keystore.p12
org.acme.client.mtls.GreetingService/mp-rest/keyStoreType=PKCS12 # or JKS
org.acme.client.mtls.GreetingService/mp-rest/keyStorePassword=password

@mschorsch
Copy link

As an alternative you could use the vert.x web client: https://quarkus.io/guides/vertx#using-vert-x-clients

WebClientOptions options = new WebClientOptions()
    .setSsl(true)
    .setPemKeyCertOptions(new PemKeyCertOptions()
        .addCertPath("path/to/cert.pem")
        .setKeyPath("path/to/key.pem"))
    .setTrustOptions(new PemTrustOptions()
        .addCertPath("path/to/cert.pem"));

WebClient client = WebClient.create(vertx, options);

@leaqui
Copy link
Contributor Author

leaqui commented May 15, 2024

Also, properties are listed at: https://es.quarkus.io/guides/all-config#quarkus-rest-client-config_quarkus-rest-client-config-rest-clients-config

But I think lost MTLS configuration doc (or a link to) at REST client guide is useful.

@geoand
Copy link
Contributor

geoand commented May 17, 2024

Do you remember anything from the docs contents so we can look through the git history?

@leaqui
Copy link
Contributor Author

leaqui commented May 17, 2024

I'm sure it was at https://quarkus.io/guides/rest-client but I can't find it at history.

I think the section title was something like Mutual - TLS

The section had a configuration block with properties like:
quarkus.rest-client.config-key.trust-store
quarkus.rest-client.config-key.trust-store-password

quarkus.rest-client.config-key.key-store
quarkus.rest-client.config-key.key-store-password

Similar to https://es.quarkus.io/guides/security-openid-connect-client-reference#mutual-tls

@geoand
Copy link
Contributor

geoand commented May 17, 2024

I had no luck in locating it unfortunately

@leaqui
Copy link
Contributor Author

leaqui commented May 17, 2024

No matter, I think adding something like https://es.quarkus.io/guides/security-openid-connect-client-reference#mutual-tls would be fine.

@cescoffier
Copy link
Member

Let's wait until the new mechanism is in place before adding anything, or I will have to change it in a few weeks.

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

No branches or pull requests

4 participants