HAProxy 1.5-dev19 Unable to load SSL certificate

haproxyssl

I've installed HAPRoxy 1.5-dev19, adn I am trying to bind using SSL.

I generated openssl certs in /etc/ssl/certs keys and validated that they are there and look good, and updated haproxy.cfg as below:

openssl req -nodes -x509 -newkey rsa:2048 -keyout /etc/ssl/certs/private.key -out /etc/ssl/certs/cert.pem -days 2000

frontend XRE
bind *:9045 ssl crt /etc/ssl/certs/private.key

But I still get:

parsing [/etc/haproxy/haproxy.cfg:48] : 'bind :443' : unable to load SSL certificate from PEM file '/etc/ssl/certs/private.key'.

Proxy 'haproxyLoopback': no SSL certificate specified for bind ':443' at [/etc/haproxy/haproxy.cfg:48] (use 'crt').

Your help is appreciated,
Many thanks,
Charlie

Best Answer

You are pointing the wrong file. It should be like this:

frontend XRE bind *:9045 ssl crt /etc/ssl/certs/cert.pem