Are SSL credentials supported by the python client yet? IOW, if my client 
does 

  creds = grpc.ssl_channel_credentials( 
    root_certificates=ca.crt, 
    private_key=client.key, 
    certificate_chain=client.crt)

how can the server access the client cert? I already have mechanisms in 
place for issuing client certs, it's a bit annoying to have a parallel 
mechanism for issuing and validating, not to mention worrying about a 
proper implementation thereof, channel credentials.

I've had this issue for a long time and I still don't have a satisfactory 
workaround.

tx

/ji

On Tuesday, January 10, 2017 at 10:19:13 PM UTC-5, Ken Payson wrote:
>
> Call credentials can only be used on a secure channel.
>
> In your example, it should look something like:
>
> call_creds = grpc.metadata_call_credentials(UsernamePasswordCallCredential
> s("foo"))
> ssl_creds = grpc.ssl_channel_credentials()
> channel_creds = grpc.composite_channel_credentials(ssl_creds, call_creds)
> channel = grpc.secure_channel("localhost:50055", channel_creds)
>
> Note that your server will need to host a secure port on localhost:50055
>
>
>
> On Tue, Jan 10, 2017 at 6:31 PM, <[email protected] <javascript:>> wrote:
>
>> Hi, I'm trying to attach CallCredentials to an RPC. This is what I've 
>> done, using AccessTokenCallCredentials as an example:
>>
>> class UsernamePasswordCallCredentials(grpc.AuthMetadataPlugin):
>>
>>  def __init__(self, username):
>>
>>        self._username = username
>>
>>  def __call__(self, context, callback):
>>
>>        print "in __call__"
>>
>>        metadata = (('x-custom-auth-ticket', self._username),)
>>
>>        callback(metadata, None)
>>
>>        
>>
>> call_creds = 
>> metadata_call_credentials(UsernamePasswordCallCredentials("foo"))
>>
>> channel = grpc.insecure_channel("localhost:50055")
>>
>> stub = my_pb2_grpc.myStub(channel) 
>>         stub.ListUser(Empty(), credentials=call_creds)
>>
>> Not only does my custom header not appear to be set, but I can't find an 
>> evidence that UsernamePasswordCallCredentials.__call__ is ever being 
>> called. Where am I going wrong?
>>
>> Thanks,
>> Scott
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "grpc.io" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/grpc-io.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/grpc-io/c5fd8d6d-f686-4e44-90e2-98e33fd8e75a%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/grpc-io/c5fd8d6d-f686-4e44-90e2-98e33fd8e75a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/cb91d7a5-ad4c-47f5-bc9f-497c8ca04c9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to