-
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
Support test certificates and SSL name override #2754
Conversation
Surfaced in GRPCCall+Tests.h Add GRPCHost to store channel config, and to create channels on demand with that config. GRPCChannels and configs are cached together. GRPCSecureChannel is now initialized with (nullable) path to a certificates file and (nullable) name override. The same mechanism will be used for creating insecure channels, removing the ability to do it by specifying the HTTP scheme in the address (which was deemed too subtle for its implications).
Diff now that #2753 is merged: https://github.com/grpc/grpc/compare/master...jcanizales:support-test-certificates?expand=1 |
@interface GRPCChannel : NSObject | ||
@property(nonatomic, readonly) struct grpc_channel *unmanagedChannel; | ||
@property(nonatomic) grpc_channel *unmanagedChannel; |
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.
Argh, this should still be readonly
.
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.
So, are you going to change this or not?
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.
Oops! Done; sorry.
NULL)]); | ||
grpc_credentials *certificates = path ? CertificatesAtPath(path) : kDefaultCertificates; | ||
|
||
// Ritual to pass the SSL host name override to the C library. |
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.
We might need other channel arguments at some point. Maybe it would be better to have a more general solution.
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.
Yeah I'm totally using the default_authority
arg channel you pointed me to, as part of issue #2642. I was thinking of having GRPCChannel
get a NSDictionary
of arguments. This is all private anyway :)
@DavidPhillipOster : This is the first change I've got pending. My teammate Michael did a pass right before going on vacation. It's made of the following commits. Going commit by commit is slower, but more manageable. The first 3 are just refactoring preparing for the 4th one, which is the interesting one. Clicking on their link will show each's diff:
#import <GRPCClient/GRPCCall+Tests.h>
...
NSBundle *bundle = [NSBundle bundleForClass:self.class];
NSString *certsPath = [bundle pathForResource:@"TestCertificates.bundle/test-certificates"
ofType:@"pem"];
[GRPCCall useTestCertsPath:certsPath testName:@"foo.test.google.fr" forHost:kLocalSSLHost]; And from then on, all RPCs to that host will use SSL with the provided test parameters. Finally, there's these 4 trivial fixes: 000fa38, e21b467, 56c6574, 7d261ee. |
Also note that only |
Thanks for the guide. I expect to get to it in about one hour. On Tue, Aug 4, 2015 at 12:27 PM, Jorge Canizales notifications@github.com
|
And add warning about using custom certificates or name override if not testing.
It’s a typedef of an anonymous struct.
Support test certificates and SSL name override in Obj-C
The link for enforcement policy in the keepalive docs is wrong. fixes grpc#2754
Fixes #2429.
(A few of the changes in the diff are from PR #2753.)
By importing
GRPCCall+Tests.h
one can register SSL config to be used for a specific host.GRPCHost
is used to store channel config, and to create channels on demand with that config.GRPCChannel
s and configs are composed and cached together.GRPCSecureChannel
is now initialized with (nullable) path to a certificates file and (nullable) name override.The same mechanism will later be used for creating insecure channels, removing the ability to do it by specifying the HTTP scheme in the address (which was deemed too subtle for its implications).