Skip to content

Micronaut mTLS with Self-Signed Certificate Without CA - Getting Unauthorized (401), but Works in Postman & Terminal #11633

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

Open
Vibhanshu3 opened this issue Feb 28, 2025 · 0 comments
Labels
type: bug Something isn't working

Comments

@Vibhanshu3
Copy link

Vibhanshu3 commented Feb 28, 2025

Expected Behavior

  1. The Micronaut HTTP client should send the client certificate correctly.
  2. The request should not be rejected with 401 Unauthorized.
  3. Since Postman & curl work fine, Micronaut should behave the same way.

Actual Behaviour

I am trying to configure Micronaut HTTP Client to communicate with a self-signed HTTPS server using mutual TLS (mTLS).

The server does not use a CA certificate, and I have set up client keystore and truststore as per the Micronaut documentation in which skipped the root CA cert.

However, I am still receiving a 401 Unauthorized error when making requests.

mTLS communication works fine in Postman & Terminal (curl). Fails with 401 Unauthorized in Micronaut HTTP Client.

application.yml (For Client):

micronaut:
  http:
    client:
      ssl:
        enabled: true
        key-store:
          path: classpath:certs/client.p12
          password: changeit
          type: PKCS12
        trust-store:
          path: classpath:certs/truststore.jks
          password: changeit
          type: JKS

Environment Information

  • JDK Version: 17

Version

3.9.6

@ojebari-ma ojebari-ma added the type: bug Something isn't working label May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants