Add CA certificate path customization for HTTPS connections #24
+11
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces the ability to customize the CA certificate path used by the UID2Client when establishing HTTPS connections. It enables setting the certificate file and directory path through the environment variables CA_CERT_FILE_PATH and CA_CERT_DIR_PATH, respectively. If these variables are not set, the client defaults to using standard paths for CA certificates.
Background:
While using uid2-client lib with OpenSSL 1.1.1k, Refresh was failing with "Failed to refresh keys: error code: 10, verify error: unable to get local issuer certificate" error. Same issue was observed when executing
openssl s_client -connect global.prod.uidapi.com:443 -showcerts
, indicating a problem with locating or validating the CA certificate. However, when specifying the certificate path directly using the-CApath
or-CAfile
option in OpenSSL, the verification succeeded. This behavior highlighted the need for a way to specify the CA certificate path in the UID2Client.Key Changes:
By allowing the CA certificate paths to be customized, this change addresses the verification issue encountered with OpenSSL 1.1.1k, providing flexibility and configurability for environments with custom CA certificates or when running in containers or non-standard environments.