0

I'm looking for a way to implement the following mTLS authenticated request in Java:

PFX=x509.pfx

curl --location --request POST 'https://example.com/' \
  --cert-type p12 \
  --cert "$PFX:mySecretPassword"

I'm using a x509 pfx file encrypted with a password.

maz
  • 143
  • 8

1 Answers1

0

For server side, choose framework like Spring. Check Spring Security docs for more. Here is intro https://www.baeldung.com/x-509-authentication-in-spring-security

To implement client only try okHttp, that is usually troublesome to use custom certificate in client, e.g. Use a certificate in an okhttp request with android

So state what exactly you want, and raise better question.

As an advise, try to use standard/default configuration as much as possible. https://www.baeldung.com/spring-boot-https-self-signed-certificate

Paul Verest
  • 60,022
  • 51
  • 208
  • 332