Skip to content

Commit

Permalink
okhttp: Fix for ipv6 link local with scope (#11725) (#11729)
Browse files Browse the repository at this point in the history
Co-authored-by: MV Shiva <speakupshiva@gmail.com>
  • Loading branch information
kannanjgithub and shivaspeaks authored Dec 9, 2024
1 parent 29dd9ba commit e98e744
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.net.HostAndPort;
import com.google.common.net.InetAddresses;
import io.grpc.internal.GrpcUtil;
import io.grpc.okhttp.internal.OptionalMethod;
import io.grpc.okhttp.internal.Platform;
Expand Down Expand Up @@ -247,7 +249,9 @@ protected void configureTlsExtensions(
} else {
SET_USE_SESSION_TICKETS.invokeOptionalWithoutCheckedException(sslSocket, true);
}
if (SET_SERVER_NAMES != null && SNI_HOST_NAME != null) {
if (SET_SERVER_NAMES != null
&& SNI_HOST_NAME != null
&& !InetAddresses.isInetAddress(HostAndPort.fromString(hostname).getHost())) {
SET_SERVER_NAMES
.invoke(sslParams, Collections.singletonList(SNI_HOST_NAME.newInstance(hostname)));
} else {
Expand Down

0 comments on commit e98e744

Please sign in to comment.