Skip to content

Commit

Permalink
feat: add support for public IP
Browse files Browse the repository at this point in the history
  • Loading branch information
ttosta-google committed Jan 17, 2024
1 parent d0611b3 commit f1d9d32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ Socket connect() throws IOException {
ipAddress = connectionInfo.getPublicIpAddress();
}

if (ipAddress == null || ipAddress.isEmpty()) {
throw new RuntimeException("No IP address for the instance");
}

// Use the instance's IP address as a HostName.
SSLParameters sslParameters = socket.getSSLParameters();
sslParameters.setServerNames(Collections.singletonList(new SNIHostName(ipAddress)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@

public enum IpType {
PUBLIC,
PRIVATE,
PSC;
PRIVATE;
}

0 comments on commit f1d9d32

Please sign in to comment.