Skip to content

Commit

Permalink
Provide a general WMS verify certificate option, for cantonal setups …
Browse files Browse the repository at this point in the history
…whose WMS are served with self-signed certificates
  • Loading branch information
jwkaltz committed Aug 20, 2024
1 parent 87b1062 commit 8310eea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions dev/config/pyramid_oereb.yml.mako
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,13 @@ 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
# Option to check certificate for external WMS. Default and recommended setting: True
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:
de: 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
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
# Option to check certificate for external WMS. Default and recommended setting: True
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!!!!
Expand Down Expand Up @@ -1413,6 +1409,9 @@ pyramid_oereb:
transfer_code: Hinweis
extract_code: Hint

# Option to check certificate for external WMS calls. Default and recommended setting: True
verify_certificate_wms: True

# The error message returned if an error occurs when requesting a static extract
# The content of the message is defined in the specification (document "Inhalt und Darstellung des statischen Auszugs")
static_error_message:
Expand Down
3 changes: 1 addition & 2 deletions pyramid_oereb/contrib/data_sources/standard/sources/plr.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ def from_db_to_view_service_record(self, view_service_from_db, legend_entry_reco
Config.get('srid'),
Config.get('proxies'),
legends=legend_entry_records,
# Note: our standard database model does not contain an option to override the verify_certificate
verify_certificate=True
verify_certificate=Config.get('verify_certificate_wms', True)
)
return view_service_record

Expand Down
4 changes: 2 additions & 2 deletions pyramid_oereb/core/readers/real_estate.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def read(self, params, nb_ident=None, number=None, egrid=None, geometry=None):
Config.get('default_language'),
Config.get('srid'),
Config.get('proxies'),
verify_certificate=plan_for_land_register_config.get('verify_certificate', True)
verify_certificate=Config.get('verify_certificate_wms', True)
)

plan_for_land_register_main_page_config = Config.get_plan_for_land_register_main_page_config()
Expand All @@ -75,7 +75,7 @@ def read(self, params, nb_ident=None, number=None, egrid=None, geometry=None):
Config.get('default_language'),
Config.get('srid'),
Config.get('proxies'),
verify_certificate=plan_for_land_register_main_page_config.get('verify_certificate', True)
verify_certificate=Config.get('verify_certificate_wms', True)
)

self._source_.read(params, nb_ident=nb_ident, number=number, egrid=egrid, geometry=geometry)
Expand Down

0 comments on commit 8310eea

Please sign in to comment.