Open secondaryconstructor opened 3 years ago
This is not supported for HttpClient
unfortunately. SecureSocket
supports this - but this is not exposed through HttpClient
APIs.
Add host
parameter to https://api.dart.dev/stable/2.10.3/dart-io/HttpClient/openUrl.html ?
Or perhaps add HttpClient::connect
that takes open SecureSocket
?
This likely could be achieved using a custom socket factory and reusing sockets, with that change introduced https://github.com/dart-lang/sdk/issues/55562 The downside is it's just been merged and there's only a couple of pre-release Flutter versions that incorporate that change (e.g. 3.24.0-0.2.pre) EDIT: 3.24 just landed and it enables that.
If we have several virtual hosts (whose name is different from HTTPS endpoint name) on server, I find no way to set custom SNIs in HttpClient while establishing a TLS connection. Any suggestions if it is anyhow possible?
I tried adding
host
in headers but it doesn't work (verified using wireshark).Currently used Dart version:
Dart 2.10.3
,stable
channel.