OPNsense Forum

Archive => 17.1 Legacy Series => Topic started by: akron on July 20, 2017, 05:47:52 pm

Title: [SOLVED] HAProxy front end SSL certificate limit?
Post by: akron on July 20, 2017, 05:47:52 pm
Hi guys,

I am hoping someone could help me.

I have HA proxy configured and integrated with Lets Encrypt, 1 Front-end on port 443 and several back-ends, ACLs etc

However I just hit the mark of 30 SSLs added to the same front-end and once I try to add more I receive a error in config

any idea why there is a limit ?

Please see the picture attached.

Thanks
Title: Re: HAProxy front end SSL certificate limit?
Post by: franco on July 21, 2017, 10:30:57 am
Hi akron,

Notified maintainer.


Cheers,
Franco
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 21, 2017, 12:48:38 pm
Hi akron,

Notified maintainer.


Cheers,
Franco

Thanks

any idea why is this happening? I'm open to speculation dont mind to try work around it...

Cheers
Title: Re: HAProxy front end SSL certificate limit?
Post by: franco on July 21, 2017, 12:51:53 pm
The error would suggest one or all certificates are put on a single line, which causes the line read to fail at some point because the line buffer is too small.

It would be in the config file, you can see the line is too long, but I have no idea why.


Cheers,
Franco
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 21, 2017, 01:15:32 pm
The error would suggest one or all certificates are put on a single line, which causes the line read to fail at some point because the line buffer is too small.

It would be in the config file, you can see the line is too long, but I have no idea why.


Cheers,
Franco

Humm I see, this only happens when I reach the 30 ssl mark, 29 ssls are fine, 30 gives the error. I can alternate the SSLs as long as i dont go over 30 everything works perfectly.

it would be a shame if there is no fix, this is such a great box OPNsense..

Cheers
Title: Re: HAProxy front end SSL certificate limit?
Post by: franco on July 21, 2017, 02:17:29 pm
But the same holds true for 31 certs or 32... Could you check the actual config file to see why the line is overly long? It's what the error says, not that it's more than 29 certs. :)


Thanks,
Franco
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 21, 2017, 02:43:46 pm
But the same holds true for 31 certs or 32... Could you check the actual config file to see why the line is overly long? It's what the error says, not that it's more than 29 certs. :)


Thanks,
Franco

Where is the config file location ?
Title: Re: HAProxy front end SSL certificate limit?
Post by: franco on July 21, 2017, 03:09:46 pm
There are two paths in your screenshot, one for a .conf file and one for a .pem file.
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 21, 2017, 03:46:26 pm
There are two paths in your screenshot, one for a .conf file and one for a .pem file.

Yes right  :)

so in the line 62 i have:

 bind PUBLIC IP:443 name PUBLIC IP:443 ssl crt /var/etc/haproxy/ssl/4435345346dcdd7a.pem crt /var/etc/haproxy/ssl/345353453534.pem crt /var/etc/haproxy/ssl/59294353454353572.pem crt /var/etc/haproxy/ssl/54354353453d.pem crt /var/etc/haproxy/ssl/3452342456.pem

and goes forever on that line until the last certificate.

is there any way to split that line into 63 and 64 so HAproxy can read it correctly ?
Title: Re: HAProxy front end SSL certificate limit?
Post by: franco on July 21, 2017, 05:34:36 pm
Can you try this simple patch? https://github.com/opnsense/plugins/commit/bd96fcfe

From the root shell it installs via:

# opnsense-patch -c plugins bd96fcfe

After that, apply the configuration again.

If it doesn't work, run the patch command again to remove the patch.


Cheers,
Franco
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 21, 2017, 06:02:44 pm
Can you try this simple patch? https://github.com/opnsense/plugins/commit/bd96fcfe

From the root shell it installs via:

# opnsense-patch -c plugins bd96fcfe

After that, apply the configuration again.

If it doesn't work, run the patch command again to remove the patch.


Cheers,
Franco

Thanks but it killed it  ;D

reverted back...

I have some ssl enforced settings on the global config... not sure if i should take it back and then apply the patch again
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 24, 2017, 04:35:40 pm
Can you try this simple patch? https://github.com/opnsense/plugins/commit/bd96fcfe

From the root shell it installs via:

# opnsense-patch -c plugins bd96fcfe

After that, apply the configuration again.

If it doesn't work, run the patch command again to remove the patch.


Cheers,
Franco

Thanks but it killed it  ;D

reverted back...

I have some ssl enforced settings on the global config... not sure if i should take it back and then apply the patch again

Hi Franco,

Any other work around worth trying ?

Cheers
Title: Re: HAProxy front end SSL certificate limit?
Post by: franco on July 24, 2017, 06:44:08 pm
Hi akron,

Looking at your output and the previous fix, the line escape was added, but the newline was missing. D'oh, sorry.

New try with *two* characters, instead of one:

https://github.com/opnsense/plugins/commit/00151b8

# opnsense-patch 00151b8


Cheers,
Franco
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 24, 2017, 10:03:22 pm
Hi akron,

Looking at your output and the previous fix, the line escape was added, but the newline was missing. D'oh, sorry.

New try with *two* characters, instead of one:

https://github.com/opnsense/plugins/commit/00151b8

# opnsense-patch 00151b8


Cheers,
Franco

Thanks Franco however it says "fetch: https://github.com/opnsense/core/commit/00151b8.patch: Not Found
"  :D

I will apply this once the link its working and let you know the result.

Cheers

Title: Re: HAProxy front end SSL certificate limit?
Post by: franco on July 24, 2017, 10:11:01 pm
# opnsense-patch -c plugins 00151b8

This is better...
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 24, 2017, 10:32:15 pm
# opnsense-patch -c plugins 00151b8

This is better...

Right, so it seems I'm getting the same error again..


Title: Re: HAProxy front end SSL certificate limit?
Post by: fraenki on July 25, 2017, 12:29:40 am
I know I'm late to the party... I'll try to prepare a fix later today, requires a few code changes and tests. :)


Regards
- Frank
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 25, 2017, 10:15:30 am
I know I'm late to the party... I'll try to prepare a fix later today, requires a few code changes and tests. :)


Regards
- Frank

Thanks no worries  ;D

Title: Re: HAProxy front end SSL certificate limit?
Post by: franco on July 25, 2017, 02:45:51 pm
According to the manual "crl" argument also takes directories, that seems to be the only solution of of this long line debacle. :D
Title: Re: HAProxy front end SSL certificate limit?
Post by: fraenki on July 25, 2017, 02:59:31 pm
According to the manual "crl" argument also takes directories, that seems to be the only solution of of this long line debacle. :D

No, actually crt-list makes more sense in this case, IMHO.
http://cbonte.github.io/haproxy-dconv/1.7/configuration.html#crt-list

I'm working on this right now.


Regards
- Frank
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 25, 2017, 03:05:38 pm
According to the manual "crl" argument also takes directories, that seems to be the only solution of of this long line debacle. :D

I have never used HAproxy before and I'm not trying to be greedy or anything or wanting infinite ssl certificates with one system. ;D

I am just short in public IPs, only one in fact and wanted to see if I could deploy further SSLs in one box.

OPNsense has been choice number one here after ditching UTM and pfsense and so far is the best traffic eater Firewall appliance i ever seen   8)

Cheers
Title: Re: HAProxy front end SSL certificate limit?
Post by: fraenki on July 25, 2017, 04:16:16 pm
The fix is ready for testing:

Code: [Select]
opnsense-patch -c plugins 6a82b37
For reference: https://github.com/opnsense/plugins/pull/209


Regards
- Frank
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 25, 2017, 04:33:27 pm
The fix is ready for testing:

Code: [Select]
opnsense-patch -c plugins 6a82b37
For reference: https://github.com/opnsense/plugins/pull/209


Regards
- Frank

Nice one fraenki is working now  ;D Thanks for this

will this be shipped in future releases or we need to always patch  ?

Thanks both for the help

Cheers
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 25, 2017, 04:40:23 pm
The fix is ready for testing:

Code: [Select]
opnsense-patch -c plugins 6a82b37
For reference: https://github.com/opnsense/plugins/pull/209


Regards
- Frank

Also where can I contribute or buy you guys a beer..?
Title: Re: HAProxy front end SSL certificate limit?
Post by: fraenki on July 25, 2017, 05:00:27 pm
will this be shipped in future releases or we need to always patch  ?

It will be available in 17.7.1 (at the latest). :)

Also where can I contribute or buy you guys a beer..?

You're always welcome to report issues, suggest enhancements or even provide some fixes:
https://github.com/opnsense/core/issues
https://github.com/opnsense/plugins/issues

On the other hand, the OPNsense projects welcomes donations too:
https://opnsense.org/donate/

Thanks for reporting this issue!


Regards
- Frank
Title: Re: HAProxy front end SSL certificate limit?
Post by: akron on July 25, 2017, 05:15:44 pm
will this be shipped in future releases or we need to always patch  ?

It will be available in 17.7.1 (at the latest). :)

Also where can I contribute or buy you guys a beer..?

You're always welcome to report issues, suggest enhancements or even provide some fixes:
https://github.com/opnsense/core/issues
https://github.com/opnsense/plugins/issues

On the other hand, the OPNsense projects welcomes donations too:
https://opnsense.org/donate/

Thanks for reporting this issue!


Regards
- Frank

Donated

Thank you
Title: Re: HAProxy front end SSL certificate limit?
Post by: franco on July 25, 2017, 05:58:09 pm
Yay, thanks to both of you! :)

We'll add this for 17.7.1, we want to play it safe for 17.7.


Cheers,
Franco