diff --git a/dev/config/pyramid_oereb.yml.mako b/dev/config/pyramid_oereb.yml.mako index 812b8598ad..97bd82e4ea 100644 --- a/dev/config/pyramid_oereb.yml.mako +++ b/dev/config/pyramid_oereb.yml.mako @@ -238,6 +238,7 @@ pyramid_oereb: fr: https://wms.geo.admin.ch/?SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0&STYLES=default&CRS=EPSG:2056&BBOX=2475000,1065000,2850000,1300000&WIDTH=493&HEIGHT=280&FORMAT=image/png&LAYERS=ch.swisstopo-vd.amtliche-vermessung layer_index: 0 layer_opacity: 1.0 + verify_certificate: True plan_for_land_register_main_page: # WMS URL to query the plan for land register specially for static extracts overview page reference_wms: @@ -245,6 +246,7 @@ pyramid_oereb: fr: https://wms.geo.admin.ch/?SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0&STYLES=default&CRS=EPSG:2056&BBOX=2475000,1065000,2850000,1300000&WIDTH=493&HEIGHT=280&FORMAT=image/png&LAYERS=ch.swisstopo-vd.amtliche-vermessung layer_index: 0 layer_opacity: 1.0 + verify_certificate: True visualisation: method: pyramid_oereb.core.hook_methods.produce_sld_content # Note: these parameters must fit to the attributes provided by the RealEstateRecord!!!! diff --git a/pyramid_oereb/core/records/view_service.py b/pyramid_oereb/core/records/view_service.py index cd88cad012..11e9d7cf64 100644 --- a/pyramid_oereb/core/records/view_service.py +++ b/pyramid_oereb/core/records/view_service.py @@ -80,7 +80,7 @@ class ViewServiceRecord(object): """ def __init__(self, reference_wms, layer_index, layer_opacity, default_language, - srid, proxies=None, legends=None): + srid, proxies=None, legends=None, verify_certificate=True): """ Args: @@ -105,6 +105,7 @@ def __init__(self, reference_wms, layer_index, layer_opacity, default_language, self.default_language = default_language self.srid = srid self.proxies = proxies + self.verify_certificate = verify_certificate if legends is None: self.legends = [] @@ -247,7 +248,7 @@ def download_wms_content(self, language): if uri_validator(wms): log.debug(f"Downloading image, url: {wms}") try: - response = requests.get(wms, proxies=self.proxies) + response = requests.get(wms, proxies=self.proxies, verify=self.verify_certificate) except Exception as ex: dedicated_msg = f"An image could not be downloaded. URL was: {wms}, error was {ex}" log.error(dedicated_msg)