Skip to content

Fix TLS certificate verification error when using an HTTP proxy#341

Merged
jelmer merged 1 commit intobreezy-team:3.3from
lgp171188:fix-tls-certificate-verification-error-when-using-http-proxy
Feb 24, 2026
Merged

Fix TLS certificate verification error when using an HTTP proxy#341
jelmer merged 1 commit intobreezy-team:3.3from
lgp171188:fix-tls-certificate-verification-error-when-using-http-proxy

Conversation

@lgp171188
Copy link
Contributor

Before this fix, the proxy hostname was wrongly used in the comparison with the TLS certificate of the destination server and caused an error. This makes use of the host variable, which is already used in the same function for showing the user a warning in a specific case but not in the SSL socket that is created, in the SSL socket.

This issue was observed while running bzr branch lp:ubuntu-archive-publishing as an anonymous user through an HTTP(S) proxy and while running bzr branch https://bzr.savannah.nongnu.org/r/records/trunk. The former error was triggered by brz trying to connect to the Launchpad XML-RPC service, which is available only over HTTPS, whereas the latter was triggered directly because of the repository being available over HTTPS.

@jelmer
Copy link
Member

jelmer commented Feb 23, 2026

You probably want to merge this into 3.3 rather than main.

@jelmer
Copy link
Member

jelmer commented Feb 23, 2026

(I'm a little but confused about the launchpad xmlrpc service, didn't we remove that?)

@lgp171188
Copy link
Contributor Author

Hi Jelmer,

(I'm a little but confused about the launchpad xmlrpc service, didn't we remove that?)

Sorry for the confusion. This fix resulted from an issue that I saw with brz 3.0.2 in Ubuntu 20.04 (to which I'm backporting some fixes from this upstream repository for other issues) while trying to run brz branch lp:ubuntu-archive-publishing through an http(s) proxy. In that case, I noticed that the only endpoint that brz was trying to talk over https was the Launchpad XML-RPC service as the actual Launchpad bzr repositories are served over plain HTTP for anonymous access.

Since I wanted to verify that this issue is also affecting other non-Launchpad bzr hosts (since Launchpad is shutting down bzr and some of the Launchpad-specific functionality has been removed from brz already), I tried it with https://bzr.savannah.nongnu.org/r/records/trunk and was able to trigger that issue.

The mention of Launchpad here is not really relevant was just to add some context, which I did not do properly. Sorry about that.

You probably want to merge this into 3.3 rather than main.

Sure. I will re-target this PR against the 3.3 branch. I checked the codebase to see if there are any tests covering this part of the codebase and as I did not find anything, I haven't added any tests here. Please let me know if you want me to try and add some tests as a prerequisite for merging this.

Before this fix, the proxy hostname was used in the comparison with the
TLS certificate of the destination server and caused an error. This
makes use of the `host` variable, which is already used in the same
function for showing the user a warning in a specific case but not in
the SSL socket that is created, in the socket.

This issue was observed while running `bzr branch
lp:ubuntu-archive-publishing` as an anonymous user through an HTTP(S)
proxy and while running `bzr branch
https://bzr.savannah.nongnu.org/r/records/trunk`. The former error was
triggered by brz trying to connect to the Launchpad xmlrpc service which
is available only over https whereas the latter was triggered directly
because of the repository being available over https.
@lgp171188
Copy link
Contributor Author

lgp171188 commented Feb 24, 2026

You probably want to merge this into 3.3 rather than main.

Since the same fix applies cleanly on top of the current 3.3 branch, I have re-targeted this PR to the 3.3 branch after cherry-picking this fix to my branch rebased on the 3.3 branch.

@lgp171188 lgp171188 changed the base branch from main to 3.3 February 24, 2026 07:31
@lgp171188 lgp171188 force-pushed the fix-tls-certificate-verification-error-when-using-http-proxy branch from 483535f to a6b374a Compare February 24, 2026 07:33
@jelmer jelmer merged commit a8d1d43 into breezy-team:3.3 Feb 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants