I have a new requirement to accept (and validate) client certificates. How
do I set things up so that client certificates are accepted, but optional?
If I call AcceptSecurityContext() with the ASC_REQ_MUTUAL_AUTH flag I can
retrieve client certs with QueryContextAttributes(). However
ASC_REQ_MUTUAL_AUTH seems to make client certs mandatory. What am I missing?
Best regards,
Rhett Gong [MSFT]
Microsoft Online Partner Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.
I was hoping that since we haven't required client certs up until now I
could make their use optional to avoid breaking existing clients.
As you can imagine since I'm implementing stuff defined in RFCs I don't
really have much room to design around any limitations of certain APIs etc.
Hopefully that isn't the problem here :)
IIS seems to support optional client certs (i.e. it supports three cert
options: "Ignore client certs", "Accept client certs", and "Require client
certs"). Does IIS not use SChannel?
Its not a show stopper if I can't use SChannel to support optional client
certs. Just slightly inconvenient. In that case do you know if the Whidbey
SslStream class will support optional client certs, or is it itself just a
wrapper around SChannel?
Thanks for your help so far.
"Rhett Gong [MSFT]" <v-ra...@online.microsoft.com> wrote in message
news:blB7NKRg...@cpmsftngxa06.phx.gbl...
If the client sends a certificate then your subsequent QueryContextAttribute
call will succeed; otherwise this call will fail. What your code does based
on this bit of information determines whether client certificates are
"required" or not.
Regards,
John Banes
[Microsoft Security Developer]
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
"Antony Perkov" <Antony...@newsgroup.nospam> wrote in message
news:%23Nu1BIJ...@TK2MSFTNGP10.phx.gbl...
When my server calls AcceptSecurityContext() with the ASC_REQ_MUTUAL_AUTH
flag, my client fails if I don't assign a certificate context in the
AcquireCredentialsHandle call.
Specifically I get an SEC_E_INCOMPLETE_CREDENTIALS ("The credentials
supplied were not complete, and could not be verified. Additional
information can be returned from the context") error on the 3rd call to
InitializeSecurityContext.
In case this helps: my client calls AcquireCredentialsHandle with the
SCH_CRED_NO_DEFAULT_CREDS flag, and InitializeSecurityContext with the
following flags: ISC_REQ_REPLAY_DETECT | ISC_REQ_SEQUENCE_DETECT |
ISC_REQ_CONFIDENTIALITY | ISC_REQ_STREAM | ISC_REQ_EXTENDED_ERROR.
Thanks for your help so far.
"John Banes [MS]" <jba...@online.microsoft.com> wrote in message
news:uEGqVYag...@tk2msftngp13.phx.gbl...
#1
It can find a client certificate, call AcquireCredentialsHandle to get a
cred handle containing the certificate, and call InitializeSecurityContext
again passing in the new cred handle. This will allow the handshake to be
completed, with the client certificate chain being sent to the server.
#2
It can skip finding a client certificate, and just call
InitializeSecurityContext back, passing in the ISC_REQ_USE_SUPPLIED_CRED
flag. This will tell schannel to send the client certificate associated with
the passed in cred handle, regardless of whether the cred handle actually
contains a client certificate or not. If the credential doesn't contain a
client certificate, then the handshake is completed without sending it.
Regards,
John Banes
[Microsoft Security Developer]
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
"Antony Perkov" <Antony...@newsgroup.nospam> wrote in message
news:%23yKk7R4...@TK2MSFTNGP10.phx.gbl...
That's fixed my issue.
Ant.
"John Banes [MS]" <jba...@online.microsoft.com> wrote in message
news:u5CHcO9g...@tk2msftngp13.phx.gbl...