Skip to content

Commit 9b2b287

Browse files
committed
refactor(gax-httpjson): configure Conscrypt NetHttpTransport for default transport in ManagedHttpJsonChannel
1 parent d57beae commit 9b2b287

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

sdk-platform-java/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/ManagedHttpJsonChannel.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ private ManagedHttpJsonChannel(
7171
this.executor = executor;
7272
this.usingDefaultExecutor = usingDefaultExecutor;
7373
this.endpoint = endpoint;
74-
this.httpTransport = httpTransport == null ? new NetHttpTransport() : httpTransport;
74+
this.httpTransport =
75+
httpTransport == null
76+
? HttpJsonTransportUtils.configureConscryptSecurityProvider(
77+
new NetHttpTransport.Builder())
78+
.build()
79+
: httpTransport;
7580
this.deadlineScheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
7681
}
7782

@@ -227,11 +232,14 @@ public ManagedHttpJsonChannel build() {
227232
usingDefaultExecutor = true;
228233
}
229234

230-
return new ManagedHttpJsonChannel(
231-
executor,
232-
usingDefaultExecutor,
233-
endpoint,
234-
httpTransport == null ? new NetHttpTransport() : httpTransport);
235+
if (httpTransport == null) {
236+
httpTransport =
237+
HttpJsonTransportUtils.configureConscryptSecurityProvider(
238+
new NetHttpTransport.Builder())
239+
.build();
240+
}
241+
242+
return new ManagedHttpJsonChannel(executor, usingDefaultExecutor, endpoint, httpTransport);
235243
}
236244
}
237245
}

0 commit comments

Comments
 (0)