ClientSession requires a DNSNameRef for the hostname argument, but a DNSNameRef cannot be constructed from an IP address.
In some situations (in my case, connecting to a PostgreSQL server) the server presents a valid certificate, signed by a trusted CA, for a specific IP address. As far as I can tell this is a valid use of TLS certificates, but it doesn't seem possible to support it with rustls at present.