fix: pass 'certPool' to Gitea client on creation#1084
Merged
stefanprodan merged 1 commit intofluxcd:mainfrom Mar 24, 2025
Merged
fix: pass 'certPool' to Gitea client on creation#1084stefanprodan merged 1 commit intofluxcd:mainfrom
stefanprodan merged 1 commit intofluxcd:mainfrom
Conversation
It is required when a custom CA is passed, otherwise the gitea.NewClient() call will fail with the 'tls: failed to verify certificate: x509: certificate signed by unknown authority' error. Because the current version of Gitea SDK performs a call to the '/api/v1/version' endpoint during a new client creation, so the 'certPool' must be passed when creating the client. Resolves: fluxcd#1083 Signed-off-by: Sergey Dreger <sergey.dreger@gmail.com>
stefanprodan
approved these changes
Mar 24, 2025
Member
stefanprodan
left a comment
There was a problem hiding this comment.
LGTM
Thanks @sdreger 🏅
PS. I realised that we're missing the proxy setting for Gitea. The NewGitea function should have a proxy string arg and when we create the transport we should be setting the proxy if one is specified like we do for all the providers, for example here. @sdreger if you have time please contribute add the proxy config in a PR. Thanks again!
Member
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release/v1.5.x
git worktree add -d .worktree/backport-1084-to-release/v1.5.x origin/release/v1.5.x
cd .worktree/backport-1084-to-release/v1.5.x
git switch --create backport-1084-to-release/v1.5.x
git cherry-pick -x 30d8d01687ef2e5a7c9f71f6c4641260b7eb5317 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
It is required when a custom CA is passed, otherwise the gitea.NewClient() call will fail with the 'tls: failed to verify certificate: x509: certificate signed by unknown authority' error. Because the current version of Gitea SDK performs a call to the '/api/v1/version' endpoint during a new client creation, so the 'certPool' must be passed when creating the client.
Resolves: #1083