Send feedback
Class TestChannelWithCertificates (0.7.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 0.7.0keyboard_arrow_down
public final class TestChannelWithCertificates
Utility functions for creating GRPC Channels that require certificates.
Static Methods
getChannelBuilderForTestHost(String host, int sslPort)
public static ManagedChannelBuilder <? >getChannelBuilderForTestHost ( String host , int sslPort )
Create a channel builder to a service running behind a default test host configuration.
Parameters
Name
Description
host
String name running the test host, typically localhost.
sslPort
int of the test host which must have HTTP2 enabled.
Returns
Type
Description
io.grpc.ManagedChannelBuilder <
? >
a connected Channel
getChannelBuilderForTestHost(String host, int sslPort, String certPath, String hostInCert)
public static ManagedChannelBuilder <? >getChannelBuilderForTestHost ( String host , int sslPort , String certPath , String hostInCert )
Create a channel builder to a service running behind the specified test host.
Parameters
Name
Description
host
String name running the test host, typically localhost.
sslPort
int of the test host which must have HTTP2 enabled.
certPath
String path to the certificate file
hostInCert
String the name of the test host within the certificate file
Returns
Type
Description
io.grpc.ManagedChannelBuilder <
? >
a connected Channel
getChannelForTestHost(String host, int sslPort)
public static ManagedChannel getChannelForTestHost ( String host , int sslPort )
Create a channel to a service running behind a default test host configuration.
Parameters
Name
Description
host
String name running the test host, typically localhost.
sslPort
int of the test host which must have HTTP2 enabled.
Returns
Type
Description
io.grpc.ManagedChannel
a connected Channel
getChannelForTestHost(String host, int sslPort, String certPath, String hostInCert)
public static ManagedChannel getChannelForTestHost ( String host , int sslPort , String certPath , String hostInCert )
Create a channel to a service running behind the specified test host configuration.
Parameters
Name
Description
host
String name running the test host, typically localhost.
sslPort
int of the test host which must have HTTP2 enabled.
certPath
String path to the certificate file
hostInCert
String the name of the test host within the certificate file
Returns
Type
Description
io.grpc.ManagedChannel
a connected Channel
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025年10月30日 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025年10月30日 UTC."],[],[]]