Skip to content

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 #597

Open
@SJLBenjamin

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions