lib/falcon/hosts.rb in falcon-0.33.3 vs lib/falcon/hosts.rb in falcon-0.33.4
- old
+ new
@@ -60,10 +60,21 @@
context.servername_cb = Proc.new do |socket, hostname|
self.host_context(socket, hostname)
end
context.session_id_context = "falcon"
- context.alpn_protocols = DEFAULT_ALPN_PROTOCOLS
+
+ context.alpn_select_cb = lambda do |protocols|
+ if protocols.include? "h2"
+ return "h2"
+ elsif protocols.include? "http/1.1"
+ return "http/1.1"
+ elsif protocols.include? "http/1.0"
+ return "http/1.0"
+ else
+ return nil
+ end
+ end
context.set_params(
ciphers: SERVER_CIPHERS,
verify_mode: OpenSSL::SSL::VERIFY_NONE,
)