File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1
1
_site /
2
+ * .swp
Original file line number Diff line number Diff line change @@ -194,6 +194,33 @@ combined_creds = ssl_creds.compose(call_creds)
194
194
stub = Helloworld ::Greeter ::Stub .new (' greeter.googleapis.com' , combined_creds)
195
195
```
196
196
197
+ ### C++
198
+
199
+ #### Base case - no encryption or authentication
200
+ ``` cpp
201
+ auto channel = grpc::CreateChannel(" localhost:50051" , InsecureChannelCredentials());
202
+ std::unique_ptr<Greeter::Stub> stub (Greeter::NewStub(channel));
203
+ ...
204
+ ```
205
+
206
+ #### With server authentication SSL/TLS
207
+
208
+ ```cpp
209
+ auto channel_creds = grpc::SslCredentials(grpc::SslCredentialsOptions());
210
+ auto channel = grpc::CreateChannel("myservice.example.com", creds);
211
+ std::unique_ptr<Greeter::Stub> stub(Greeter::NewStub(channel));
212
+ ...
213
+ ```
214
+
215
+ #### Authenticate with Google using scopeless credentials
216
+
217
+ ``` cpp
218
+ auto creds = grpc::GoogleDefaultCredentials();
219
+ auto channel = grpc::CreateChannel(" greeter.googleapis.com" , creds);
220
+ std::unique_ptr<Greeter::Stub> stub (Greeter::NewStub(channel));
221
+ ...
222
+ ```
223
+
197
224
### C#
198
225
199
226
#### Base case - no encryption or authentication
You can’t perform that action at this time.
0 commit comments