-
Notifications
You must be signed in to change notification settings - Fork 50
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
ALPN support #49
ALPN support #49
Conversation
src/tls_stream.rs
Outdated
unsafe { | ||
let mut client_protos: sspi::SecPkgContext_ApplicationProtocol = mem::zeroed(); | ||
let client_protos_ptr = &mut client_protos as *mut sspi::SecPkgContext_ApplicationProtocol; | ||
assert_eq!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assert will need to be replaced with proper error handling, but I'm not sure what the possible errors are here, and how we should deal with them as MSDN doesn't really give much info on that.
@steffengy This should be working for all versions of windows which support alpn now. Also it seems like the appveyor tests are failing because for some reason alpn isn't enabled on them? |
Appveyor seems to be using the So you say schannel doesn't fail/return an error when you pass ALPNs to it, but it doesn't support them? |
Actually I wrong in was assuming that the appveyor behaviour was what happens on older versions of windows. I just tested and it will return As far as checking if negotiation succeeded automatically that should be doable. I still really don't know why the test won't pass on appveyor. I have no idea what is different there to any other machine I have tried it on. |
Yeah, good point so we can probably leave that to the caller for now. Have you tried with configuring |
Yes. No matter which image is configured the test fails. It acts as if the handshake happens without ALPN being requested. I even tried adding a test which does ALPN over loopback to be sure the accepting socket is offering ALPN. (I'll probably add those tests to this PR even though they didn't help with appveyor as the existing test only tests ALPN on the client). |
Unfortunately I haven't really been able to figure out what's going on here since I can't reproduce it on any machine I have access to. As far as I can tell the |
@Eroc33 Have you tried looking into it on appveyor iself with the newest image? |
I wasn't aware that was possible, but I'll see if that helps me figure out what's going on when I have a bit more time to look into this. |
Hello @Eroc33 and @steffengy, I could repro the issue on Amazon EC2's Windows instance, but couldn't figure out the cause. Oddly adding "http/1.0" somehow fixes the issue. |
I'd like to pick this back up if possible. I believe the reason that this diff is currently failing is because |
@cyang1 I think it's unlikely this PR will be picked up, so feel free to open a new one. |
First pass at supporting ALPN, this should work for both client and server, but some cleanup is still needed, especially given how poor the docs on MSDN are for info on ALPN in schannel.