At the moment, the only way of setting the hostname (for verification and SNI) is using tls_context. This precludes tls_stream from being used for connections that target different hostnames.
Say, for example, an HTTP redirection:
- A stream is created from a context. The hostname is set in this context.
- TLS handshake succeeds.
- The HTTP server returns a redirection code, with a different hostname on it.
- The stream is reset().
- How do I change the hostname on this reset stream?
At the moment, the only way of setting the hostname (for verification and SNI) is using
tls_context. This precludestls_streamfrom being used for connections that target different hostnames.Say, for example, an HTTP redirection: