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 std.crypto.tls.Server #14171

Open
Tracked by #14178
andrewrk opened this issue Jan 3, 2023 · 6 comments
Open
Tracked by #14178

add std.crypto.tls.Server #14171

andrewrk opened this issue Jan 3, 2023 · 6 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Jan 3, 2023

Extracted from #13980.

We already have std.crypto.tls.Client. Now it's time to additionally add a server.

Once we have both, they can be used to test each other.

@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library. labels Jan 3, 2023
@andrewrk andrewrk added this to the 0.11.0 milestone Jan 3, 2023
@richiejp
Copy link

richiejp commented May 4, 2023

Is anyone currently working on this? I'd like it for an experiment, but I'm not sure how long it will take for me to implement.

@laoshaw
Copy link

laoshaw commented Jun 22, 2023

I read somewhere tls.server was not the focus for stdlib as tls.client is here for package management, it will be really cool though for zig has tls.server implemented just like what golang does, so zig can be easily used for web without external dependencies.

in the meantime this looks good: https://github.com/mattnite/zig-mbedtls

@richiejp
Copy link

Yup. I did also realise that my HTTP/2 server can use h2c with a proxy that simply wraps the TCP connection in TLS with ALPN.

@laoshaw
Copy link

laoshaw commented Jun 28, 2023

that's good for use cases where a zig-http(h2c) server runs behind a proxy who does the ssl termination(ALPN termination?), however zig will be used in embedded systems and typically has no proxy, the embedded device will have to deal with https directly, which is why zig-mbedtls exists I think.

@clickingbuttons
Copy link
Contributor

I'm currently working on this in order to debug the TLS client.

@clickingbuttons
Copy link
Contributor

Happy to report I've followed along with https://tls13.xargs.org/ (which I've used as a unit test) until the server new session tickets. The client and server can send application data messages!

I skipped cert verification and there are some memory optimizations left.

Big PR coming in the next week or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants