-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
There are rare use cases for this. Quoting @sortie:
As I said, e.g. you need to connect to some fixed IP (maybe some localhost port, or you needed to resolve the hostname ahead of time to make sure it does not resolve to the local network if you don't trust the hostname, for security reasons, this is done in pub.dev e.g.) but connect as if you are connecting to a given secure hostname. Those situations are rare but legitimate and I was thinking we could probably get away with this policy without needing to frontload solving that problem.
One use case cropped up in grpc package. In here, the client is trying to upgrade a socket to SecureSocket via an authority host. Two options come to mind to support it:
-
Support another API for
SecureSocket.connectwhich accepts an authority host in addition to destination host/port and bypassesSocket.connect. -
Support insecure socket upgrade properly. This might involve poisoning the Socket instance such that no data exchange is allowed until TLS handshake is started. I am not sure how difficult this would be. Handshake immediately calls
_detachRaw().