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

WOODPECKER_GITEA_SKIP_VERIFY is no effect #605

Closed
4 tasks done
zxcvbnm3057 opened this issue Dec 13, 2021 · 18 comments · Fixed by #1152
Closed
4 tasks done

WOODPECKER_GITEA_SKIP_VERIFY is no effect #605

zxcvbnm3057 opened this issue Dec 13, 2021 · 18 comments · Fixed by #1152
Labels
bug Something isn't working
Milestone

Comments

@zxcvbnm3057
Copy link

Component

server

Describe the bug

I set both WOODPECKER_GITEA_SKIP_VERIFY=true and DRONE_GITEA_SKIP_VERIFY=true in docker environment but still get the error x509: certificate signed by unknown authority . My server is using cert sign by Encryption Everywhere DV TLS CA - G1. Any help?

System Info

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"v0.14.3"}

Additional context

time="2021-12-13T09:27:56Z" level=error msg="cannot authenticate user. Post \"https://******/login/oauth/access_token\": x509: certificate signed by unknown authority"

Validations

@6543 6543 added the forge/gitea gitea forge related label Dec 13, 2021
@6543 6543 modified the milestones: 0.15.0, 0.14.4 Dec 13, 2021
@6543
Copy link
Member

6543 commented Dec 13, 2021

since I guess it's about go-gitea/gitea#17964

you have to use the current master branch until v0.15.0 got released - so just stick to latest
(v0.14.* do not support path​ filter for gitea)

@6543
Copy link
Member

6543 commented Dec 13, 2021

and I guess the root CAs would need an update so we would have to backport the docker files and rebuild - that should fix it

@6543 6543 added bug Something isn't working and removed forge/gitea gitea forge related pending:bug labels Dec 13, 2021
6543 added a commit that referenced this issue Dec 13, 2021
@6543 6543 closed this as completed Dec 13, 2021
@zxcvbnm3057
Copy link
Author

thanks, I have solved it. That was nginx-proxy.

@zxcvbnm3057
Copy link
Author

new error:

time="2021-12-13T20:15:27Z" level=error msg="cannot authenticate user. oauth2: cannot fetch token: 405 Method Not Allowed\nResponse: "

It happened when I confirm the oauth request in gitea

@zxcvbnm3057
Copy link
Author

There is also an error report in Gitea log

Completed GET /login/oauth/access_token 405 Method Not Allowed in 204.447µs

@zxcvbnm3057
Copy link
Author

and I guess the root CAs would need an update so we would have to backport the docker files and rebuild - that should fix it

That might be. But I still confuse about why WOODPECKER_GITEA_SKIP_VERIFY and DRONE_GITEA_SKIP_VERIFY doesn't work?

@6543
Copy link
Member

6543 commented Dec 13, 2021

well they should work for selve signed certs

@deB4SH
Copy link

deB4SH commented Mar 22, 2022

Hi,
tested this feature with the image woodpeckerci/woodpecker-server:v0.15 and WOODPECKER_GITEA_SKIP_VERIFY seems to still have no effect.
The git certificate is signed by my own ca.

{"time":"2022-03-22T17:17:48Z","message":"LogLevel = warn"}
{"level":"error","time":"2022-03-22T17:18:00Z","message":"cannot authenticate user. Post \"https://git.lan/login/oauth/access_token\": x509: certificate signed by unknown authority"}

@pixrl
Copy link

pixrl commented Jul 20, 2022

Hi, tested this feature with the image woodpeckerci/woodpecker-server:v0.15 and WOODPECKER_GITEA_SKIP_VERIFY seems to still have no effect. The git certificate is signed by my own ca.

{"time":"2022-03-22T17:17:48Z","message":"LogLevel = warn"}
{"level":"error","time":"2022-03-22T17:18:00Z","message":"cannot authenticate user. Post \"https://git.lan/login/oauth/access_token\": x509: certificate signed by unknown authority"}

I confirm that it does not work for me aswell.

{"level":"error","time":"2022-07-20T19:36:04+02:00","message":"cannot authenticate user. Post \"https://git.lan/login/oauth/access_token\": x509: certificate signed by unknown authority"}
woodpecker-server version 0.15.3

@6543 6543 modified the milestones: 0.14.4, 0.15.4 Jul 21, 2022
@6543 6543 reopened this Jul 21, 2022
@ptpu
Copy link

ptpu commented Aug 17, 2022

Hey, i have the same issue on that. I'm using step-ca for self-signed certifcates. And setting WOODPECKER_GITEA_SKIP_VERIFY does not have an effect and I get the same error as mentioned above.

@6543
Copy link
Member

6543 commented Sep 1, 2022

I just fixed the issue for gitlab ... so I'll now know what to do :)

6543 added a commit to 6543-forks/woodpecker that referenced this issue Sep 1, 2022
6543 added a commit to 6543-forks/woodpecker that referenced this issue Sep 1, 2022
@6543 6543 closed this as completed in #1152 Sep 1, 2022
@metzgerd
Copy link

Is this already implemented in the latest / next docker image?
I tried both versions with WOODPECKER_GITEA_SKIP_VERIFY=true but still get the following error message on clone during the pipeline.

+ git fetch --no-tags origin +refs/heads/main:
fatal: unable to access 'https://git.demo.com/test/test.git/': SSL certificate problem: self-signed certificate

@6543
Copy link
Member

6543 commented Sep 11, 2022

ah that's a plugin-git thing ... you need a custom clone step too:

@metzgerd
Copy link

Perfect. Thank you. One Step further.
Now it says could not read user name. I will have a deeper look in the documentation.
fatal: could not read Username for 'https://git.demo.com': No such device or address

@6543
Copy link
Member

6543 commented Sep 11, 2022

it user netrc to auth ...

@metzgerd
Copy link

Thank you for the hint with netrc. Its working with public Repos but not working on private Repos. But I do not know how to troubleshoot.

woodpecker-agent     | {"level":"debug","repo":"test/test","build":"25","id":"89","image":"docker.io/woodpeckerci/plugin-git:latest","stage":"git","time":"2022-09-12T07:42:55Z","message":"log stream opened"}
gitea                | 2022/09/12 07:42:55 [631ee2ff] router: completed GET /test/test.git/info/refs?service=git-upload-pack for 172.18.0.1:0, 401 Unauthorized in 2.1ms @ repo/http.go:532(repo.GetInfoRefs)

@6543
Copy link
Member

6543 commented Sep 13, 2022

See what gitea api reports if you get repo info ... it should have private: true but currently there are edgecases where it's not (if org is priv .or limit. and repo set to public, api reports public even if it's not)

@6543
Copy link
Member

6543 commented Sep 13, 2022

@metzgerd this is worth it's own issue I'll lock this one now, for chating we have discord or matrix

@woodpecker-ci woodpecker-ci locked as resolved and limited conversation to collaborators Sep 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants