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

Add certificate chain validation to MutualSSLAuthenticator handler #12289

Merged

Conversation

SavinduDimal
Copy link
Contributor

Purpose

Description

  • In the current implementation of MutualSSLAuthenticator handler client certificate should exist in the truststore to a successful validation
  • This PR introduces certificate chain validation to resolve the above limitation
  • Following configuration is introduced to the deployment.toml to enable certificate chain validation
[apimgt.mutual_ssl]
enable_certificate_chain_validation = true

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 12.24490% with 129 lines in your changes are missing coverage. Please review.

Project coverage is 47.34%. Comparing base (062820a) to head (60f0dab).
Report is 35 commits behind head on master.

Files Patch % Lines
...security/authenticator/MutualSSLAuthenticator.java 7.44% 85 Missing and 2 partials ⚠️
...org/wso2/carbon/apimgt/gateway/handlers/Utils.java 32.25% 18 Missing and 3 partials ⚠️
...n/apimgt/impl/utils/GatewayCertificateMgtUtil.java 0.00% 21 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #12289      +/-   ##
============================================
+ Coverage     47.29%   47.34%   +0.04%     
- Complexity     4123     4145      +22     
============================================
  Files          1840     1841       +1     
  Lines        136407   136577     +170     
  Branches      19734    19776      +42     
============================================
+ Hits          64517    64664     +147     
- Misses        64281    64285       +4     
- Partials       7609     7628      +19     
Flag Coverage Δ
integration_tests 42.08% <12.24%> (+0.08%) ⬆️
unit_tests 20.40% <3.40%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Add implementation to create complete certificate chain from certificates available in the trust store
Add an utility class for gateway certificate management
Add new configuration enable_certificate_chain_validation to api-manager.xml.j2
@SavinduDimal SavinduDimal force-pushed the mtls-certificate-chain-validation branch from c10bdc3 to 60f0dab Compare March 20, 2024 11:23
@SavinduDimal SavinduDimal merged commit 43131b0 into wso2:master Mar 27, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use custom root CA with Mutual SSL and invoke APIs with a signed certificate
2 participants