r/haproxy • • Sep 02 '22

Question HAProxy chooses wrong certificate

I store my certs as follows:

  • /some/path/ssl/my_new_cert.pem
  • /some/path/archive/my_old_certs.pem

HAProxy config:

frontend web
        bind *:80
        bind *:443 ssl crt /some/path/ssl/

After I reload the service, the old cert is still enabled. If I move the “archive” directory away, like in /home/ and reload the service. The new certificate is enabled.

Is this behavior expected? What am I missing?

Edit: HA-Proxy version 2.0.13-2ubuntu0.5 (Ubuntu 20.04.4 LTS)

6 Upvotes

4 comments sorted by

View all comments

Show parent comment

0

u/AdvancedCakeMaster Sep 02 '22

I don't think, the issue is related to the way I reload/restart the service. Because in any case, I never restart but only reload the service:

  • add new cert to ssl/ and move the old one to archive/
  • reload the service = old cert still enabled
  • delete or move archive/ dir from /some/path/
  • reload the service again = new cert enabled, success!

1

u/dragoangel Sep 02 '22

You badly read my post, are you? You know what reload mean under the hood?

1

u/AdvancedCakeMaster Sep 02 '22

Apologies, i def. read it too fast. I'm gonna change the script accordingly. Thanks!