In smaller deployments, it's common to have the topurl setting point at the same webserver as the hub, like:
topurl
[kojidev] server = https://kojidev.example.com/kojihub topurl = https://kojidev.example.com/kojifiles serverca = ~/.koji/pki/koji-ca.kojidev.example.com.crt
The CLI does not re-use the Koji session's requests.Session object to download files. This means that we use the serverca option to do hub RPCs, but not for koji download-build.
requests.Session
serverca
koji download-build
$ koji -p kojidev download-build bash-5.0.17-2.fc33 2020-12-23 14:32:23,743 [ERROR] koji: SSLError: HTTPSConnectionPool(host='kojidev.example.com', port=443): Max retries exceeded with url: /kojifiles/packages/bash/5.0.17/2.fc32/src/bash-5.0.17-2.fc33.src.rpm (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1124)')))
Does it make sense for koji download-build to use the same serverca option?
I could foresee this breaking some environments where users use an internal CA to talk to the hub, but the topurl setting points to a different webserver that has an HTTPS cert signed by a different CA.
Steps to reproduce
server
koji -p kojidev hello
koji -p kojidev download-build bash-5.0.17-2.fc33
Actual Results koji fails to download the build (see SSLError above)
koji
Expected Results koji uses the serverca setting just like the other sub-commands
Additional information I can use the REQUESTS_CA_BUNDLE environment variable like so:
REQUESTS_CA_BUNDLE
REQUESTS_CA_BUNDLE=~/.koji/pki/koji-ca.kojidev.example.com.crt kojidev download-build bash-5.0.17-2.fc33
PR #2619
As described above, this breaks the scenario where users want to use a custom, non-system-wide CA for the hub, but a system-wide CA for the topurl.
My answer to that is that if you want to use two different HTTPS CAs for different parts of Koji, you should trust both CAs system-wide and then not use the serverca client option at all.
Metadata Update from @tkopecek: - Custom field Size adjusted to None - Issue set to the milestone: 1.24
Metadata Update from @tkopecek: - Issue set to the milestone: 1.25 (was: 1.24)
@ktdreyer Do you want to create documentation PR or should I write something?
Sure, I've added the kojid piece as a commit in PR #2724.
I didn't make time to add the sentence to the client config to satisfy koji download-build yet.
Metadata Update from @tkopecek: - Issue set to the milestone: None (was: 1.25)
Metadata Update from @tkopecek: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)
This issue has been migrated to Fedora Forge: https://forge.fedoraproject.org/koji/koji/issues/2618
Please continue any further discussion there.