File tree 1 file changed +5
-1
lines changed
okhttp/src/main/java/io/grpc/okhttp
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 19
19
import static com .google .common .base .Preconditions .checkNotNull ;
20
20
21
21
import com .google .common .annotations .VisibleForTesting ;
22
+ import com .google .common .net .HostAndPort ;
23
+ import com .google .common .net .InetAddresses ;
22
24
import io .grpc .internal .GrpcUtil ;
23
25
import io .grpc .okhttp .internal .OptionalMethod ;
24
26
import io .grpc .okhttp .internal .Platform ;
@@ -247,7 +249,9 @@ protected void configureTlsExtensions(
247
249
} else {
248
250
SET_USE_SESSION_TICKETS .invokeOptionalWithoutCheckedException (sslSocket , true );
249
251
}
250
- if (SET_SERVER_NAMES != null && SNI_HOST_NAME != null ) {
252
+ if (SET_SERVER_NAMES != null
253
+ && SNI_HOST_NAME != null
254
+ && !InetAddresses .isInetAddress (HostAndPort .fromString (hostname ).getHost ())) {
251
255
SET_SERVER_NAMES
252
256
.invoke (sslParams , Collections .singletonList (SNI_HOST_NAME .newInstance (hostname )));
253
257
} else {
You can’t perform that action at this time.
0 commit comments