Hi,
Yes, I can do it , this is the result : (curl -vv https://www.example.com )
* Expire in 0 ms for 6 (transfer 0x7fffbb5cff50)
* Expire in 1 ms for 1 (transfer 0x7fffbb5cff50)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Expire in 1 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 2 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 1 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 1 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 4 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 2 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 2 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 4 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 3 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 3 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 4 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 3 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 3 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 4 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 4 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 4 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 4 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 4 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 4 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 8 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 6 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 6 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 8 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 6 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 6 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 8 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 8 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 8 ms for 1 (transfer 0x7fffbb5cff50)
* Expire in 9 ms for 1 (transfer 0x7fffbb5cff50)
* Trying 78.222.220.190...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x7fffbb5cff50)
* Connected to www.example.com (78.222.220.190) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [19 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [2816 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [520 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=www.example.com
* start date: Oct 16 13:36:07 2020 GMT
* expire date: Jan 14 13:36:07 2021 GMT
* subjectAltName: host "www.example.com" matched cert's "www.example.com"
* issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
} [5 bytes data]
* Using Stream ID: 1 (easy handle 0x7fffbb5cff50)
} [5 bytes data]
> GET / HTTP/2
> Host: www.example.com
> User-Agent: curl/7.64.0
> Accept: */*
>
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [57 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [57 bytes data]
* old SSL session ID is stale, removing
{ [5 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
} [5 bytes data]
< HTTP/2 400
< cache-control: no-cache
< content-type: text/html
<
{ [90 bytes data]
100 90 0 90 0 0 967 0 --:--:-- --:--:-- --:--:-- 978
* Connection #0 to host www.example.com left intact
Is this happening with 100% of the HTTPS requests?
Are you accessing port 443 or one of those high ports 8000-9000 ?
Are you sure the modified configuration provided corresponds with what you are running here?
I kept looking, and yes, I changed the configuration, but the result is the same.
All my https requests on port 443 or in the range 8000-9000 give me the same result : 400 Bad request.
This my haproxy.cgf at this point :
global
log /dev/log local0
log /dev/log local1 debug
chroot /var/lib/haproxy
#stats socket /var/run/haproxy.sock mode 660 level admin expose-fd listeners
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 5s
user haproxy
group haproxy
daemon
tune.ssl.default-dh-param 2048
# generated 2020-10-19, Mozilla Guideline v5.6, HAProxy 1.8.19, OpenSSL 1.1.1d, modern configuration, no HSTS
# https://ssl-config.mozilla.org/#server=haproxy&version=1.8.19&config=modern&openssl=1.1.1d&hsts=false&guideline=5.6
# modern configuration
ssl-default-bind-options prefer-client-ciphers no-sslv3 no-tlsv10 no-tlsv11 no-tlsv12 no-tls-tickets
ssl-default-server-options no-sslv3 no-tlsv10 no-tlsv11 no-tlsv12 no-tls-tickets
defaults
log global
mode http
option httplog
option dontlognull
option forwardfor
option http_proxy
option accept-invalid-http-request
timeout connect 5000
timeout client 50000
timeout server 5000
stats enable
stats hide-version
stats refresh 5s
stats uri /hastats
frontend w-http
bind *:80
reqadd X-Forwarded-Proto:\ http
default_backend w-backend
option accept-invalid-http-request
# Test URI to see if its a le request
acl le-acl path_beg /.well-known/acme-challenge/
use_backend le-backend if le-acl
frontend w-https
mode http
option forwardfor
option http_proxy
option accept-invalid-http-request
bind *:8000-9000 ssl crt /etc/haproxy/certs/radio4.lips.ovh.pem
bind *:443 ssl crt /etc/haproxy/certs/radio4.lips.ovh.pem alpn h2,http/1.1
reqadd X-Forwarded-Proto:\ https
http-request set-header X-Real-IP %[src]
#http-request add-header X-Forwarded-Proto https
#http-request add-header X-Forwarded-Port 443
# set HTTP Strict Transport Security (HTST) header
http-response add-header Strict-Transport-Security max-age=15768000
default_backend w-backend
backend w-backend
mode http
http-request set-header X-Forwarded-For %[src]
reqadd X-Forwarded-Proto:\ https
option http-server-close
option accept-invalid-http-request
balance roundrobin
redirect scheme https if !{ ssl_fc }
server web1 192.168.56.101:80 check
server web2 192.168.56.102:80 check
backend le-backend
server le 127.0.0.1:8080