springdoc-openapi-gradle-plugin icon indicating copy to clipboard operation
springdoc-openapi-gradle-plugin copied to clipboard

Support Truststore to Resolve SSL Handshake Failures with Self-Signed Certificates

Open JiangHongTiao opened this issue 1 year ago • 0 comments

Issue Summary

Our application, configured for HTTPS-only mode, fails to fetch OpenAPI documentation due to SSL handshake errors with self-signed certificates during local development.

Details

The root of the issue lies in the fact that our self-signed CA certificate is not included in Java's cacerts TrustStore. Since we might use different Java environments, adding the certificate to cacerts is not a viable solution. Consequently, the SSL handshake fails because Java does not trust our self-signed certificate. A potential solution is to provide a TrustStore in the connection's SSL context, which current plugin setup does not support.

Expected Behaviour

The application should successfully establish HTTPS connections, even with self-signed certificates, particularly for fetching OpenAPI documentation during local development.

Steps to Reproduce

  1. Configure the application for HTTPS communication.
  2. Use a self-signed certificate for local development.
  3. Attempt to fetch OpenAPI documentation over HTTPS.

Proposed Solution

Modify plugin to allow configuring a custom TrustStore, enabling Java to trust it during SSL handshakes.

Criticality of the Issue

This issue is blocking local development and testing processes, where self-signed certificates are commonly used.

JiangHongTiao avatar Nov 28 '23 20:11 JiangHongTiao