From 72fa27514e1b212fa59635ecc05acedffaa631fb Mon Sep 17 00:00:00 2001 From: yomna Date: Thu, 27 Apr 2017 10:46:33 -0700 Subject: [PATCH] fix for issue 4132: increasing server_names_hash_bucket_size if necessary (#4496) * increases server_names_hash_bucket_size if it's too low in your nginx conf * switching from k,v pairwise indices -> inner_line * simply using bucket_directive --- certbot-nginx/certbot_nginx/tls_sni_01.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/certbot-nginx/certbot_nginx/tls_sni_01.py b/certbot-nginx/certbot_nginx/tls_sni_01.py index 2e8125911..347d9f21f 100644 --- a/certbot-nginx/certbot_nginx/tls_sni_01.py +++ b/certbot-nginx/certbot_nginx/tls_sni_01.py @@ -100,9 +100,13 @@ class NginxTlsSni01(common.TLSSNI01): if line[0] == ['http']: body = line[1] found_bucket = False + posn = 0 for inner_line in body: if inner_line[0] == bucket_directive[1]: + if int(inner_line[1]) < int(bucket_directive[3]): + body[posn] = bucket_directive found_bucket = True + posn += 1 if not found_bucket: body.insert(0, bucket_directive) if include_directive not in body: