grpc-kotlin icon indicating copy to clipboard operation
grpc-kotlin copied to clipboard

OkHttpServer defaults to using ipv6 addresses, but during Google CTS testing, system applications are not allowed to use ipv6, resulting in CTS being unable to pass

Open SJLBenjamin opened this issue 1 year ago • 1 comments
trafficstars

GRPC create HttpServer:

public final class OkHttpServerProvider extends ServerProvider {

@Override protected NewServerBuilderResult newServerBuilderForPort(int port, ServerCredentials creds) {

return NewServerBuilderResult.serverBuilder(
...
    //todo  defaults to using an ipv6 address
    new OkHttpServerBuilder(new InetSocketAddress(port), result.factory));

} }

CTS Test: java.lang.AssertionError: on-device tests failed: android.appsecurity.cts.listeningports.ListeningPortsTest#testNoAccessibleListeningPorts: android.appsecurity.cts.listeningports.ListeningPortsTest$ListeningPortsAssertionError: Found port listening on addr=::, port=55231, UID=1000 [....] at android.appsecurity.cts.listeningports.ListeningPortsTest.testNoAccessibleListeningPorts(ListeningPortsTest.java:170)

at android.appsecurity.cts.Utils.runDeviceTests(Utils.java:129) at android.appsecurity.cts.Utils.runDeviceTests(Utils.java:75) at android.appsecurity.cts.Utils.runDeviceTests(Utils.java:63) at android.appsecurity.cts.ListeningPortsTest.assertNoAccessibleListeningPorts(ListeningPortsTest.java:225) at android.appsecurity.cts.ListeningPortsTest.testNoRemotelyAccessibleListeningTcp6Ports(ListeningPortsTest.java:101)

Please provide a method of using only IPV4 as the server

SJLBenjamin avatar Apr 28 '24 08:04 SJLBenjamin