1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-26 07:41:33 +03:00

Support Openresty in the NGINX plugin (#5467)

* fixes #4919 openresty_support

* making the regex more general

* reformatting warning to pass lint

* Fix string formatting in logging function

* Fix LE_AUTO_VERSION
This commit is contained in:
Alokin Software Pvt Ltd
2018-03-23 06:20:05 +05:30
committed by ohemorange
parent 8e9a4447ff
commit 693cb1d162

View File

@@ -895,7 +895,7 @@ class NginxConfigurator(common.Installer):
raise errors.PluginError(
"Unable to run %s -V" % self.conf('ctl'))
version_regex = re.compile(r"nginx/([0-9\.]*)", re.IGNORECASE)
version_regex = re.compile(r"nginx version: ([^/]+)/([0-9\.]*)", re.IGNORECASE)
version_matches = version_regex.findall(text)
sni_regex = re.compile(r"TLS SNI support enabled", re.IGNORECASE)
@@ -912,7 +912,12 @@ class NginxConfigurator(common.Installer):
if not sni_matches:
raise errors.PluginError("Nginx build doesn't support SNI")
nginx_version = tuple([int(i) for i in version_matches[0].split(".")])
product_name, product_version = version_matches[0]
if product_name is not 'nginx':
logger.warning("NGINX derivative %s is not officially supported by"
" certbot", product_name)
nginx_version = tuple([int(i) for i in product_version.split(".")])
# nginx < 0.8.48 uses machine hostname as default server_name instead of
# the empty string