Giter Site home page Giter Site logo

Comments (5)

jethrogb avatar jethrogb commented on August 30, 2024

This can be fixed by passing in winapi::ISC_REQ_USE_SUPPLIED_CREDS to InitializeSecurityContextW in TlsStream::step_initialize. Possibly in a second call in response to the SEC_I_INCOMPLETE_CREDENTIALS error. Is its non-use intentional? Not setting the flag will automatically use the system's client certificates without programmer interaction.

from schannel-rs.

steffengy avatar steffengy commented on August 30, 2024

AFAIK there isn't a reason it is not passed in.
(except maybe suboptimal documentation)

1.)

The only thing I was worried about is that we guarantee
that added certificates are considered for client authentication.

After reading some nested layers of documentation, the only thing this flag seems to change
for that is that it reduces the search scope to the certificates linked to the handle
acquired by AcquireCredentialsHandle.
So in my opinion this exactly does what we want.

2.)

From a users perspective it might be strange to get a terminated connection
from the server (when it requires a certificate but none was specified).
Not sure about a good way to improve the ergonomics here.

@sfackler

from schannel-rs.

jethrogb avatar jethrogb commented on August 30, 2024

From a users perspective it might be strange to get a terminated connection
from the server (when it requires a certificate but none was specified).

It is up to the server to terminate the connection. If it asked for a cert, but didn't get one, the server can decide to proceed as normal or abort.

from schannel-rs.

steffengy avatar steffengy commented on August 30, 2024

It is up to the server to terminate the connection. If it asked for a cert, but didn't get one, the server can decide to proceed as normal or abort.

That's exactly the point.
A user of this library in this case cannot determine that the server aborted
because of a missing certificate (and mitigate that by specifying one and retrying).

It could presume that but the server going offline, a firewall dropping the request, ...
would look the same.

To recap: The issue is an issue of ergonomics: It might happen that someone
notices a mysterious bug where the server terminates the connection.
After several hours of work and troubleshooting this someone notices that the
actual issue is a not specified client certificate.

==> The termination cause is not transparent to the user. It's hidden
and exposed as a very generic - clearly unhelpful - error for that case.

from schannel-rs.

jethrogb avatar jethrogb commented on August 30, 2024

Technically, in such a case the server is to send a handshake_failure TLS alert. At least in principle, this would be distinguishable from other network-related failure modes. Whether this happens in practice and whether that level of error makes it back to the user, I don't know.

from schannel-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.