module Async::HTTP::Protocol::HTTPS

def self.protocol_for(stream)

def self.protocol_for(stream)
	# alpn_protocol is only available if openssl v1.0.2+
	name = stream.io.alpn_protocol
	
	Async.logger.debug(self) {"Negotiating protocol #{name.inspect}..."}
	
	if protocol = HANDLERS[name]
		return protocol
	else
		throw ArgumentError.new("Could not determine protocol for connection (#{name.inspect}).")
	end
end