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

add builder interface for making servers #1122

Merged
merged 22 commits into from
Oct 2, 2024
Merged

add builder interface for making servers #1122

merged 22 commits into from
Oct 2, 2024

Conversation

davepacheco
Copy link
Collaborator

Split from #1120. Depends on #1121.

This PR adds a new builder interface for constructing servers. I changed a few of the examples and tests to use it, but not all of them yet in case we want to iterate on the interface in review.

Copy link
Collaborator

@ahl ahl left a comment

Choose a reason for hiding this comment

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

looks good.

What's your thinking on if/when we replace the old interface?

dropshot/src/server.rs Show resolved Hide resolved
Base automatically changed from dap/commonize-only to main September 27, 2024 20:01
@davepacheco
Copy link
Collaborator Author

As usual for non-trivial interfaces changes, even though this is not a breaking one, I like to try it on Omicron first. That worked out pretty well:
oxidecomputer/omicron#6730

All of these were pretty trivial to convert and all of them immediately called start() on the new HttpServerStarter.

@davepacheco
Copy link
Collaborator Author

Windows CI is failing:
https://github.com/oxidecomputer/dropshot/actions/runs/11115639926/job/30884457056#step:7:898

This appears to be steffengy/schannel-rs#106. We're getting schannel via:

dap@zathras dropshot-builder-only $ cargo tree -i schannel --target all
schannel v0.1.19
├── native-tls v0.2.12
│   ├── hyper-tls v0.6.0
│   │   └── reqwest v0.12.8
│   │       [dev-dependencies]
│   │       └── dropshot v0.12.1-dev (/Users/dap/oxide/dropshot-builder-only/dropshot)
│   ├── reqwest v0.12.8 (*)
│   └── tokio-native-tls v0.3.1
│       ├── hyper-tls v0.6.0 (*)
│       └── reqwest v0.12.8 (*)
└── rustls-native-certs v0.7.0
    └── hyper-rustls v0.26.0
        [dev-dependencies]
        └── dropshot v0.12.1-dev (/Users/dap/oxide/dropshot-builder-only/dropshot)

One of those is hyper-rustls, which we're a little behind on (see #1110) and it's possible updating that may help? For now though I'm going to disable this test on Windows because this isn't trying to verify TLS functionality (we do that elsewhere) -- just that this constructor does successfully start TLS.

@davepacheco
Copy link
Collaborator Author

Despite my threat to just disable this test on Windows, the lingering fear of papering over something important keeps me from doing it.

I was able to work around the panic by updating schannel with cargo update to 0.1.24. Now on Windows we get a failure to verify the TLS certificate, even though we're adding it to the reqwest root store. Here are some related potentially issues:

seanmonstar/reqwest#826
sfackler/rust-native-tls#233

It seems possible that the certificate being generated by rcgen, which is P-256, is not supported with the native Windows APIs that are being used here.

I'm going to try using rustls-tls (this is just for our own tests) to see if that helps.

@davepacheco davepacheco marked this pull request as ready for review October 2, 2024 18:03
@davepacheco davepacheco merged commit 5f04943 into main Oct 2, 2024
10 checks passed
@davepacheco davepacheco deleted the dap/builder-only branch October 2, 2024 18:12
@seddonm1 seddonm1 mentioned this pull request Nov 7, 2024
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