Skip to content

Commit

Permalink
Support Openresty in the NGINX plugin (#5467)
Browse files Browse the repository at this point in the history
* fixes #4919 openresty_support

* making the regex more general

* reformatting warning to pass lint

* Fix string formatting in logging function

* Fix LE_AUTO_VERSION
  • Loading branch information
Alokin Software Pvt Ltd authored and ohemorange committed Mar 23, 2018
1 parent 8e9a444 commit 693cb1d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions certbot-nginx/certbot_nginx/configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ def get_version(self):
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)
Expand All @@ -912,7 +912,12 @@ def get_version(self):
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
Expand Down

0 comments on commit 693cb1d

Please sign in to comment.