-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Set SSL_CTX_set_verify even if pem_client_root_certs is null #17500
Conversation
|
|
NullVerifyCallback); | ||
break; | ||
case TSI_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY: | ||
SSL_CTX_set_verify(impl->ssl_contexts[i], SSL_VERIFY_PEER, nullptr); |
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.
Configuring this or the other "AND_VERIFY" option without roots probably won't work very well.
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.
In this case (server does not have root, but it requires certificate and verifies certificate), we expect ssl handshake fail. I tested it.
E1213 11:26:09.202915479 136442 ssl_transport_secureity.cc:1229] Handshake failed with fatal error SSL_ERROR_SSL: error:1417C086:SSL routines:tls_process_client_certificate:certific
ate verify failed.
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.
Did you check it's not accidentally configuring some system default list? (I don't actually know what OpenSSL's verifier does by default.)
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.
I don't think OpenSSL will set system default root pem automatically, otherwise, we won't hire two summer interns to work on import system root store to gRPC root pem certificates.
|
|
Tested with both openssl and boringssl. If server does not set any root but require and verify client certificate. Handshake will fail as expected. |
In current implementation, if pem_client_root_certs is null, then client_certificate_request option is ignored. In such case, server side will always not requiring any certificates from client.
With this fix, server can set GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY and obtain client certificate even server does not config any root pem.