how to enable npn in ssl on haproxy 1.8
Use the npn keyword on the bind line. Refer to the documentation for more details. Note that npn support has been rermoved from major browsers in favor of ALPN.
When I turn on both of them, I’ll make a error haproxy
bind 192.168.0.31:443 ssl crt /etc/haproxy/certs/ssl.pem alpn npn h2,http/1.1,http/1.0
How can I apply these two things together?
Just because you add npn doesn’t mean the syntax of alpn changes.
alpn h2,http/1.1 npn h2,http/1.1
Both NPN and http/1.0 do not have any effect for browsers.
Confirmed, with the configuration above will enable both and you will see both active in the ssllabs reprt.