Score:0

HA Proxy fails ssl validation

in flag

We are using a Godaddy wild card certificate on HA (Wildcard.pem) and custom CA certs on the backends. The in-house CA is trusted by HA and all servers. I can access all backend servers individually without any problems but when we enable SSL validation, the health check fails with 503 error almost immediately.

HA configs

frontend api.qa.domain.com_esil_HTTPS_443_VS_172.20.25.69
    mode http
    bind 172.20.25.69:80
    bind 172.20.25.69:443 ssl crt /etc/hapee-2.4/ssl/Wildcard.pem ciphers ECDHE-RSA-AES128-CBC-SHA:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-CBC-SHA:AES128-SHA:AES256-SHA:ECDHE-ECDSA-AES128-SHA:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS ssl-min-ver TLSv1.2
    http-after-response replace-header set-cookie "^(my.session=.*)" "\1; SameSite=Strict" 
    http-request set-var(txn.path) path
    http-request set-var(req.backend) str(api.qa.domain.com_loggingservices_http_33313_POOL) if { path -i -m beg /loggingservice/ }
    
    use_backend %[var(req.backend)]

    backend api.qa.domain.com_loggingservice_http_333_POOL
    mode http
    http-request return status 503 content-type "text/html; charset=utf-8" lf-file /etc/hapee-2.4/apps/app_offline.htm if { nbsrv() le 0 }

    balance roundrobin
    dynamic-cookie-key Av3ryS3curek3y
    option httpchk GET /loggingservice/v1/_healthcheck HTTP/1.1
    http-check send hdr host api.qa.domain.com
    http-check expect status 200
    server QA_SERVER1_Node 10.133.20.24:333 check ssl verify none

Do I need to merge our backend certs which we created using our CA with the GoDaddy pem file? if yes, what would be the correct order?

Score:0
jp flag

Yes, you need to merge the custom CA certs with the GoDaddy cert file to create a combined cert file that can be used as the value for the ca-file option in your HAProxy backend server configuration. The correct order for the certificates in the combined file is:

The leaf certificate (your GoDaddy wildcard cert)

The intermediate certificate (GoDaddy's cert chain)

The root certificate (your custom CA cert)

To create the combined cert file, you can use a text editor to copy and paste the contents of each certificate file into a single file in the correct order. Alternatively, you can use the cat command in Linux to concatenate the files, like this:

cat leaf.crt intermediate.crt customCA.crt > combined_cert.pem

Once you have created the combined cert file, you can update your HAProxy backend server configuration to use the ssl verify required ca-file option, like this:

backend api.qa.domain.com_loggingservice_http_333_POOL
    mode http
    http-request return status 503 content-type "text/html; charset=utf-8" lf-file /etc/hapee-2.4/apps/app_offline.htm if { nbsrv() le 0 }

    balance roundrobin
    dynamic-cookie-key Av3ryS3curek3y
    option httpchk GET /loggingservice/v1/_healthcheck HTTP/1.1
    http-check send hdr host api.qa.domain.com
    http-check expect status 200
    server QA_SERVER1_Node 10.133.20.24:333 check ssl verify required ca-file /path/to/combined_cert.pem

With this configuration, HAProxy will verify the SSL certificates presented by the backend servers using the custom CA cert, and the health check should pass if the certificates are valid.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.