Skip to content

[AndroidCrypto] Any TargetHost input is set as SNI hostname #79143

@simonrozsival

Description

@simonrozsival

On Android, we put any TargetHost passed to a client SslStream into the SNI hostname:

This is a problem when the hostname doesn't conform to the STD 3 ASCII rules (see SNIHostName docs). In this case, the code throws an exception and we can't establish communication with the server.

One particular case, that also shows in our functional tests, are IPv6 addresses. The colon symbol is not allowed and an exception is thrown. The Android crypto PAL tracking issue (#45741) also mentions underscores in hostnames.

The RFC 6066 that defines SNI states:

Literal IPv4 and IPv6 addresses are not permitted in "HostName".

I think that our Android PAL shouldn't throw exceptions when SNIHostName rejects an IPv6 address and it should proceed with the handshake.

/cc @wfurt
Ref #77386 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions