global chroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 4000 user haproxy group haproxy daemon stats socket /var/lib/haproxy/stats defaults timeout client 30s timeout server 30s timeout connect 5s maxconn 3000frontend https bind *:444 mode tcp tcp-request inspect-delay 5s acl exchange req.ssl_sni -i ha-test.local acl config req.ssl_sni -i cnf-test.local tcp-request content accept if exchange tcp-request content accept if config tcp-request content reject use_backend exc if exchange use_backend cnf if configbackend exc mode tcp no option checkcache no option httpclose server server1 localhost:443backend cnf mode tcp no option checkcache no option httpclose server server1 192.168.82.250:8443 check
## Automatically generated configuration.# Do not edit this file manually.#global # NOTE: Could be a security issue, but required for some feature. uid 80 gid 80 chroot /var/haproxy daemon stats socket /var/run/haproxy.socket level admin nbproc 1 nbthread 1 tune.ssl.default-dh-param 1024 spread-checks 0 tune.chksize 16384 tune.bufsize 16384 tune.lua.maxmem 0 log /var/run/log len 65535 local0defaults log global option redispatch -1 timeout client 30s timeout connect 30s timeout server 30s retries 3# autogenerated entries for ACLs# autogenerated entries for config in backends/frontends# autogenerated entries for stats# Frontend: WebGUIClientCertCheckProxy ()frontend WebGUIClientCertCheckProxy bind 192.168.82.250:8443 name 192.168.82.250:8443 ssl ca-file /tmp/haproxy/ssl/5c6e94492253d2.87190125.calist verify required crt-list /tmp/haproxy/ssl/5c6e94492253d2.87190125.certlist mode http option http-keep-alive default_backend WebGUIBackend # tuning options timeout client 30s # logging options option log-separate-errors option httplog # WARNING: pass through options below this line option tcplog# Frontend: HTTPSProxy ()frontend HTTPSProxy bind 192.168.22.2:443 name 192.168.22.2:443 mode tcp # tuning options timeout client 30s # logging options option tcplog # ACL: WebGUI-SNI-Rule acl acl_5c75143c261ba1.96471201 req.ssl_sni -i cnf-test.local # ACL: Webserver-SNI-Rule acl acl_5c6e9491ad86b4.89663855 req.ssl_sni -i web-test.local # ACTION: WebGUI-ACL use_backend WebGUIClientCertCheckBackend if acl_5c75143c261ba1.96471201 # ACTION: Webserver-ACL use_backend WebserverBackend if acl_5c6e9491ad86b4.89663855# Backend: WebGUIBackend ()backend WebGUIBackend # health checking is DISABLED mode http balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s http-reuse never server WebGUI 127.0.0.1:443 ssl verify none# Backend: WebGUIClientCertCheckBackend ()backend WebGUIClientCertCheckBackend # health checking is DISABLED mode tcp balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s server WebGUI 127.0.0.1:443 ssl verify none# Backend: WebserverBackend ()backend WebserverBackend # health checking is DISABLED mode tcp balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 30s timeout server 30s server Webserver 192.168.82.4:443 ssl verify none
Feb 26 11:23:37 haproxy[40924]: <IP phys. Host>:58490 [26/Feb/2019:11:23:37.159] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:23:36 haproxy[40924]: <IP phys. Host>:58487 [26/Feb/2019:11:23:36.989] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:23:36 haproxy[40924]: <IP phys. Host>:58485 [26/Feb/2019:11:23:36.842] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:23:36 haproxy[40924]: <IP phys. Host>:58482 [26/Feb/2019:11:23:36.628] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:23:36 haproxy[40924]: <IP phys. Host>:58480 [26/Feb/2019:11:23:36.457] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:23:36 haproxy[40924]: <IP phys. Host>:58478 [26/Feb/2019:11:23:36.203] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:23:35 haproxy[40924]: <IP phys. Host>:58475 [26/Feb/2019:11:23:35.825] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0
Feb 26 11:29:26 haproxy[40924]: <IP phys. Host>:58687 [26/Feb/2019:11:29:26.691] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:29:26 haproxy[40924]: <IP phys. Host>:58685 [26/Feb/2019:11:29:26.662] HTTPSProxy WebGUIClientCertCheckBackend/WebGUI 1/16/17 0 -- 1/1/0/0/0 0/0Feb 26 11:29:26 haproxy[40924]: <IP phys. Host>:58683 [26/Feb/2019:11:29:26.563] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0
Hallo fabian,das mit dem TCP Mode hatte ich auch so eingestellt. Der Proxy leitet ja in diesem Modus alles verschlüsselt weiter ohne die Verbindung "aufzubrechen", lediglich der SNI Wert im Klartext wird für das "Routing" ausgewertet, soweit ich das verstanden habe. Ich selber bin leider kein Proxy oder nginx Experte.
Wenn ich den HAProxy starte und mich per Browser (Firefox und EDGE getestet), kommt sofort ein Verbindungsfehler. In der Log des HAProxys auf der OPNsense erscheint folgendes (IP des phys. Host "geschwärzt"), eine Verbindung ist also da, aber irgendwie wertet der Proxy den SNI nicht korrekt aus:Code: [Select]Feb 26 11:23:37 haproxy[40924]: <IP phys. Host>:58490 [26/Feb/2019:11:23:37.159] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:23:36 haproxy[40924]: <IP phys. Host>:58487 [26/Feb/2019:11:23:36.989] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:23:36 haproxy[40924]: <IP phys. Host>:58485 [26/Feb/2019:11:23:36.842] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:23:36 haproxy[40924]: <IP phys. Host>:58482 [26/Feb/2019:11:23:36.628] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:23:36 haproxy[40924]: <IP phys. Host>:58480 [26/Feb/2019:11:23:36.457] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:23:36 haproxy[40924]: <IP phys. Host>:58478 [26/Feb/2019:11:23:36.203] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Feb 26 11:23:35 haproxy[40924]: <IP phys. Host>:58475 [26/Feb/2019:11:23:35.825] HTTPSProxy HTTPSProxy/<NOSRV> -1/-1/0 0 SC 1/1/0/0/0 0/0Wo ist in der zweiten Config der Fehler?
tcp-request content accept if acl_5c75143c261ba1.96471201tcp-request content accept if acl_5c6e9491ad86b4.89663855tcp-request inspect-delay 5s
## Automatically generated configuration.# Do not edit this file manually.#global # NOTE: Could be a security issue, but required for some feature. uid 80 gid 80 chroot /var/haproxy daemon stats socket /var/run/haproxy.socket level admin nbproc 1 nbthread 1 maxconn 4000 tune.ssl.default-dh-param 1024 spread-checks 0 tune.chksize 16384 tune.bufsize 16384 tune.lua.maxmem 0 log /var/run/log len 65535 local0defaults log global option redispatch -1 maxconn 3000 timeout client 30s timeout connect 5s timeout server 30s retries 3# autogenerated entries for ACLs# autogenerated entries for config in backends/frontends# autogenerated entries for stats# Frontend: WebGUIClientCertCheckProxy ()frontend WebGUIClientCertCheckProxy bind 127.0.0.1:8443 name 127.0.0.1:8443 ssl ca-file /tmp/haproxy/ssl/5c6e94492253d2.87190125.calist verify required crt-list /tmp/haproxy/ssl/5c6e94492253d2.87190125.certlist mode http option http-keep-alive default_backend WebGUI # tuning options timeout client 30s # logging options option log-separate-errors option httplog# Frontend: HTTPSProxy ()frontend HTTPSProxy bind 192.168.22.2:443 name 192.168.22.2:443 mode tcp default_backend OpenVPNBackend # tuning options timeout client 30s # logging options option tcplog # ACL: WebGUI-SNI-Rule acl acl_5c75143c261ba1.96471201 req.ssl_sni -i cnf-test.local # ACL: Webserver-SNI-Rule acl acl_5c6e9491ad86b4.89663855 req.ssl_sni -i web-test.local # ACTION: 100-WebGUI-TCP-Accept tcp-request content accept if acl_5c75143c261ba1.96471201 # ACTION: 101-Webserver-TCP-Accept tcp-request content accept if acl_5c6e9491ad86b4.89663855 # ACTION: 201-Webserver-ACL-Backend use_backend WebserverBackend if acl_5c6e9491ad86b4.89663855 # ACTION: 200-WebGUI-ACL-Backend use_backend WebGUIClientCertCheckBackend if acl_5c75143c261ba1.96471201 # WARNING: pass through options below this line tcp-request inspect-delay 5s# Backend: WebGUIClientCertCheckBackend ()backend WebGUIClientCertCheckBackend # health checking is DISABLED mode tcp balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 5s timeout server 30s server WebGUIClientCertCheck 127.0.0.1:8443 # Backend: WebserverBackend ()backend WebserverBackend # health checking is DISABLED mode tcp balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 5s timeout server 30s server Webserver 192.168.82.4:443 # Backend: WebGUI ()backend WebGUI # health checking is DISABLED mode http balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 5s timeout server 30s http-reuse never server WebGUI 127.0.0.1:443 ssl verify none# Backend: OpenVPNBackend ()backend OpenVPNBackend # health checking is DISABLED mode tcp balance source # stickiness stick-table type ip size 50k expire 30m stick on src # tuning options timeout connect 5s timeout server 30s server OpenVPN 127.0.0.1:1194
Ich verwende Webinoly, um VPS Server (https://webinoly.com/en/) zu erstellen, und Webinoly kann SSL für die Website auf diesem Hosting konfigurieren. Ich habe die obige Nachricht gelesen, weiß aber immer noch nicht, wie ich das machen soll. Können Sie SSL Passthough mit dem HAProxy Plugin Schritt für Schritt überprüfen und erklären? Vielen Dank! Ich habe Google Translate to German verwendet.English: I'm using webinoly to make VPS Server (https://webinoly.com/en/) and webinoly can configure SSL for website on this hosting. I read message above but I still don't know how to do this. Could you check and explain step by step SSL Passthough with HAProxy Plugin? Thanks!