spring-cloud / spring-cloud/spring-cloud-gateway

Add support .jks truststore cert file format

Open
#1,756 10 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Java
Stars
4.9k
Forks
3.5k
Avg merge
20h 57m
Merged PRs (30d)
8

Description

I have one scenario where I have to use client-truststore.jks file format in our Spring cloud gateway to connect with HttpClient host.
But somehow spring cloud gateway doesn't like this cert format and throwing error Could not load CertificateFactory X.509 on startup of application but on other hand when I am using .pem cert file format instead of .jks file it is working fine.
So my question here is does Spring cloud gateway only support .pem cert format ? Or do we have some short of way where can we use jks cert format.

Doesn't supporting : client-truststore.jks

spring:
   cloud:
     gateway:
       httpclient:
         connect-timeout: 100000
         response-timeout: 15s
         ssl:
           trustedX509Certificates:
             - client-truststore.jks
           handshake-timeout: 1000000

Do Support : client-truststore.pem

spring:
   cloud:
     gateway:
       httpclient:
         connect-timeout: 100000
         response-timeout: 15s
         ssl:
           trustedX509Certificates:
             - client-truststore.pem
           handshake-timeout: 1000000

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the Spring Cloud Gateway httpclient.ssl.trustedX509Certificates configuration and reproduce the startup error with client-truststore.jks, comparing it with client-truststore.pem. Done means the gateway can use the JKS truststore format through this configuration without the CertificateFactory X.509 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
api, backend, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.