module Async::HTTP::Protocol::HTTPS

def self.protocol_for(peer)

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