JAVA corretto21 SPRING "javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated"

16 hours ago 1
ARTICLE AD BOX

I've got a microservices system in Java Spring Boot

I create my SSL self-signed key and stores like this way

File "sub.conf"

[req] default_bits = 4096 prompt = no default_md = sha256 x509_extensions = v3_req distinguished_name = dn [dn] C = IN ST = MAH L = PUNE O = JAM emailAddress = [email protected] CN = it+ [v3_req] subjectAltName = @alt_names [alt_names] DNS.1 = localhost

Commands

"# Non-interactive and 10 years expiration" > openssl -x509 -newkey rsa:4096 -sha256 -nodes -keyout "\key.pem" -days 3560 -out "crt.pem" -config "sub.conf" "# > create the keystore" > openssl pkcs12 -inkey key.pem -in crt.pem -export -out myapp.p12; "# > create the truststore" > keytool -importkeystore -srckeystore myapp.p12 -srcstoretype pkcs12 -destkeystore myapp.jks -deststoretype JKS

Client "application.yml"

# ============================================================== # = Authentication Server JWT # ============================================================== server: port: 9100 ssl: enabled: true trust-store: E:\myapp.p12 # The path to the keystore containing the certificate trust-store-password: <tspwd> trust-store-type: PKCS12 bundle: "mybundle" spring: application: name: AUTH-SERVICE ssl: bundle: pem: mybundle: keystore: certificate: "/crt.pem" private-key: "/key.pem" truststore: certificate: "/crt.pem"

Server "application.yml"

server: port: 5000 ssl: enabled: true key-store: E:\myapp.p12 # The path to the keystore containing the certificate key-store-password: <kspwd> key-store-type: PKCS12 trust-store: E:\myapp.jks # The path to the keystore containing the certificate trust-store-password: <tspwd> trust-store-type: jks bundle: "mybundle" spring: application: name: GestUser ssl: bundle: pem: mybundle: keystore: certificate: "/crt.pem" private-key: "/key.pem" truststore: certificate: "/crt.pem"

It is working good but in deployment logs, between the securing and the message secured, got this exception in server side logs deployment.. wanted to resolve this curious case and understanding something..

"o.s.security.web.FilterChainProxy : Securing GET /api/utenti/cerca/userid/anonymous

o.a.tomcat.util.net.jsse.JSSESupport : Error trying to obtain a certificate from the client

javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

o.s.security.web.FilterChainProxy : Secured GET /api/utenti/cerca/userid/anonymous"

Read Entire Article