Class CredentialsHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The system property to use to set the type of credentials to use.static final String
The system property that sets the location of the TLS CA file.static final String
The system property that sets the location of the TLS cert file.static final String
The system property that sets the location of the TLS key file.static final String
The system property that sets the password for the TLS key file.static final String
The system property that sets the URI of a file to read to obtain the password for the TLS key file. -
Method Summary
Modifier and TypeMethodDescriptionstatic io.grpc.ChannelCredentials
createChannelCredentials
(String sChannelName) Deprecated.static io.grpc.ChannelCredentials
createChannelCredentials
(String sChannelName, SocketProviderBuilder socketBuilder) Create theChannelCredentials
to use for the client channel.static io.grpc.ServerCredentials
Deprecated.server credentials are configured by the socket provider for a gRPC proxy service, seecreateServerCredentials(SocketProviderBuilder)
static io.grpc.ServerCredentials
createServerCredentials
(SocketProviderBuilder socketBuilder) Create theServerCredentials
to use for the gRPC Proxy.
-
Field Details
-
PROP_TLS_KEY
The system property that sets the location of the TLS key file.- See Also:
-
PROP_TLS_KEYPASS
The system property that sets the password for the TLS key file.- See Also:
-
PROP_TLS_KEYPASS_URI
The system property that sets the URI of a file to read to obtain the password for the TLS key file.- See Also:
-
PROP_TLS_CERT
The system property that sets the location of the TLS cert file.- See Also:
-
PROP_TLS_CA
The system property that sets the location of the TLS CA file.- See Also:
-
PROP_CREDENTIALS
The system property to use to set the type of credentials to use.- See Also:
-
-
Method Details
-
createServerCredentials
Deprecated.server credentials are configured by the socket provider for a gRPC proxy service, seecreateServerCredentials(SocketProviderBuilder)
Create theServerCredentials
to use for the gRPC Proxy.- Returns:
- the
ServerCredentials
to use for the gRPC Proxy
-
createServerCredentials
public static io.grpc.ServerCredentials createServerCredentials(SocketProviderBuilder socketBuilder) Create theServerCredentials
to use for the gRPC Proxy.- Parameters:
socketBuilder
- the optionalSocketProviderBuilder
to use to provide the TLS configuration- Returns:
- the
ServerCredentials
to use for the gRPC Proxy
-
createChannelCredentials
@Deprecated(since="22.06.2") public static io.grpc.ChannelCredentials createChannelCredentials(String sChannelName) Deprecated.server credentials are configured by the socket provider for a gRPC channel, seecreateChannelCredentials(String, SocketProviderBuilder)
Create theChannelCredentials
to use for the client channel.If the property
PROP_CREDENTIALS
is "plaintext" then a non-TLS credentials will be created.If the property
PROP_CREDENTIALS
is "insecure" then TLS credentials will be created using an insecure trust manager that will not verify the server certs.If the property
PROP_CREDENTIALS
is "tls" then TLS credentials will be created using a specified key (from thePROP_TLS_KEY
) and cert from (from thePROP_TLS_CERT
). Optionally a key password (from thePROP_TLS_KEYPASS
) and a CA (from thePROP_TLS_CA
) may also be provided.If the property
PROP_CREDENTIALS
is not set, "plaintext" will be used.- Parameters:
sChannelName
- the name of the channel- Returns:
- the
ChannelCredentials
to use for the client channel.
-
createChannelCredentials
public static io.grpc.ChannelCredentials createChannelCredentials(String sChannelName, SocketProviderBuilder socketBuilder) Create theChannelCredentials
to use for the client channel.If the property
PROP_CREDENTIALS
is "plaintext" then a non-TLS credentials will be created.If the property
PROP_CREDENTIALS
is "insecure" then TLS credentials will be created using an insecure trust manager that will not verify the server certs.If the property
PROP_CREDENTIALS
is "tls" then TLS credentials will be created using a specified key (from thePROP_TLS_KEY
) and cert from (from thePROP_TLS_CERT
). Optionally a key password (from thePROP_TLS_KEYPASS
) and a CA (from thePROP_TLS_CA
) may also be provided.If the property
PROP_CREDENTIALS
is not set, "plaintext" will be used.- Parameters:
sChannelName
- the name of the channel- Returns:
- the
ChannelCredentials
to use for the client channel.
-
createChannelCredentials(String, SocketProviderBuilder)