Skip to content

Commit 659c4b1

Browse files
author
Xudong Ma
committed
Benchmark: Enable/Disable TLS for okhttp accordingly
1 parent bf53a0e commit 659c4b1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • benchmarks/src/main/java/io/grpc/benchmarks/qps

benchmarks/src/main/java/io/grpc/benchmarks/qps/Utils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ static Channel newClientChannel(ClientConfiguration config) throws IOException {
134134
OkHttpChannelBuilder builder = OkHttpChannelBuilder
135135
.forAddress(addr.getHostName(), addr.getPort())
136136
.executor(config.directExecutor ? MoreExecutors.newDirectExecutorService() : null);
137+
builder.negotiationType(config.tls ? io.grpc.transport.okhttp.NegotiationType.TLS
138+
: io.grpc.transport.okhttp.NegotiationType.PLAINTEXT);
137139
if (config.tls) {
138140
SSLSocketFactory factory;
139141
if (config.testca) {

0 commit comments

Comments
 (0)