Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
775ec1de
Commit
775ec1de
authored
9 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Use SSL override as a default host name if none is specified
parent
dc31ef38
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/grpc/grpc.h
+8
-0
8 additions, 0 deletions
include/grpc/grpc.h
include/grpc/grpc_security.h
+0
-9
0 additions, 9 deletions
include/grpc/grpc_security.h
src/core/surface/channel.c
+19
-0
19 additions, 0 deletions
src/core/surface/channel.c
with
27 additions
and
9 deletions
include/grpc/grpc.h
+
8
−
0
View file @
775ec1de
...
...
@@ -134,6 +134,14 @@ typedef struct {
/** Secondary user agent: goes at the end of the user-agent metadata
sent on each request */
#define GRPC_ARG_SECONDARY_USER_AGENT_STRING "grpc.secondary_user_agent"
/* The caller of the secure_channel_create functions may override the target
name used for SSL host name checking using this channel argument which is of
type GRPC_ARG_STRING. This *should* be used for testing only.
If this argument is not specified, the name used for SSL host name checking
will be the target parameter (assuming that the secure channel is an SSL
channel). If this parameter is specified and the underlying is not an SSL
channel, it will just be ignored. */
#define GRPC_SSL_TARGET_NAME_OVERRIDE_ARG "grpc.ssl_target_name_override"
/** Connectivity state of a channel. */
typedef
enum
{
...
...
This diff is collapsed.
Click to expand it.
include/grpc/grpc_security.h
+
0
−
9
View file @
775ec1de
...
...
@@ -142,15 +142,6 @@ grpc_credentials *grpc_iam_credentials_create(const char *authorization_token,
/* --- Secure channel creation. --- */
/* The caller of the secure_channel_create functions may override the target
name used for SSL host name checking using this channel argument which is of
type GRPC_ARG_STRING. This *should* be used for testing only.
If this argument is not specified, the name used for SSL host name checking
will be the target parameter (assuming that the secure channel is an SSL
channel). If this parameter is specified and the underlying is not an SSL
channel, it will just be ignored. */
#define GRPC_SSL_TARGET_NAME_OVERRIDE_ARG "grpc.ssl_target_name_override"
/* Creates a secure channel using the passed-in credentials. */
grpc_channel
*
grpc_secure_channel_create
(
grpc_credentials
*
creds
,
const
char
*
target
,
...
...
This diff is collapsed.
Click to expand it.
src/core/surface/channel.c
+
19
−
0
View file @
775ec1de
...
...
@@ -141,9 +141,28 @@ grpc_channel *grpc_channel_create_from_filters(
gpr_log
(
GPR_ERROR
,
"%s: must be an string"
,
GRPC_ARG_DEFAULT_AUTHORITY
);
}
else
{
if
(
channel
->
default_authority
)
{
/* setting this takes precedence over anything else */
GRPC_MDELEM_UNREF
(
channel
->
default_authority
);
}
channel
->
default_authority
=
grpc_mdelem_from_strings
(
mdctx
,
":authority"
,
args
->
args
[
i
].
value
.
string
);
}
}
else
if
(
0
==
strcmp
(
args
->
args
[
i
].
key
,
GRPC_SSL_TARGET_NAME_OVERRIDE_ARG
))
{
if
(
args
->
args
[
i
].
type
!=
GRPC_ARG_STRING
)
{
gpr_log
(
GPR_ERROR
,
"%s: must be an string"
,
GRPC_SSL_TARGET_NAME_OVERRIDE_ARG
);
}
else
{
if
(
channel
->
default_authority
)
{
/* other ways of setting this (notably ssl) take precedence */
gpr_log
(
GPR_ERROR
,
"%s: default host already set some other way"
,
GRPC_ARG_DEFAULT_AUTHORITY
);
}
else
{
channel
->
default_authority
=
grpc_mdelem_from_strings
(
mdctx
,
":authority"
,
args
->
args
[
i
].
value
.
string
);
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment