Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Comments

Reuse HTTP client, and accept typed root cert store#63

Merged
nothingmuch merged 2 commits intopayjoin:mainfrom
nothingmuch:typed-root-cert-store
Mar 14, 2025
Merged

Reuse HTTP client, and accept typed root cert store#63
nothingmuch merged 2 commits intopayjoin:mainfrom
nothingmuch:typed-root-cert-store

Conversation

@nothingmuch
Copy link
Collaborator

Instead of creating an HTTP client once per forward request, a long lived client is cloned for each request.

In the test constructor, requires that a rustls::RootCertStore be passed as a configuration for the long lived client directly in from TestServices instead of conditionally checking for an env var specified cert root file.

Inexplicably I got it in my head that the e2e tests runs the relay as a binary. Fortunately this is not actually the case, eliminating the potential headache of managing an environment variable with tokio tests. Unfortunately this raises the question, should we run the relay binary in the e2e tests? My vote would be no

Embarrassingly replaces the short lived #61, i mean #62 😳

Copy link
Collaborator

@spacebear21 spacebear21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 9598fca

@spacebear21
Copy link
Collaborator

I love this new design, and I agree that we don't need to run the ohttp-relay binary in the payjoin e2e tests. If we wanted to we could add a test in ohttp-relay that just starts and shutdowns a server using the binary to ensure that path works.

In the rust-payjoin e2e tests the relay is embedded in the test
services and as such can just receive a typed RootCertStore argument in
a _test-util gated function, instead of loading native certs gated by
that same feature.
@nothingmuch nothingmuch force-pushed the typed-root-cert-store branch from 9598fca to 99cbe1f Compare March 14, 2025 19:53
Copy link
Collaborator

@DanGould DanGould left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 99cbe1f

@nothingmuch nothingmuch merged commit b8153e5 into payjoin:main Mar 14, 2025
5 checks passed
@nothingmuch nothingmuch deleted the typed-root-cert-store branch March 14, 2025 21:42
DanGould added a commit to payjoin/rust-payjoin that referenced this pull request Mar 14, 2025
Instead of submitting OHTTP requests directly to the directory's OHTTP
gateway, give the OHTTP gateway's self signed certificate to the relay
so it can connect to it, and exercise the relay in the integration
tests.

This change updates`payjoin-test-util`'s `Cargo.toml` to use a git
origin for the merge commit of payjoin/ohttp-relay#63, as such it needs
to be followed up with a commit that specifies an updated version before
release.
nothingmuch added a commit to payjoin/rust-payjoin that referenced this pull request Mar 17, 2025
@nothingmuch nothingmuch mentioned this pull request Mar 17, 2025
node-smithxby72w added a commit to node-smithxby72w/rust-payjoin that referenced this pull request Sep 28, 2025
Instead of submitting OHTTP requests directly to the directory's OHTTP
gateway, give the OHTTP gateway's self signed certificate to the relay
so it can connect to it, and exercise the relay in the integration
tests.

This change updates`payjoin-test-util`'s `Cargo.toml` to use a git
origin for the merge commit of payjoin/ohttp-relay#63, as such it needs
to be followed up with a commit that specifies an updated version before
release.
node-smithxby72w added a commit to node-smithxby72w/rust-payjoin that referenced this pull request Sep 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants