Skip to content
Permalink
Browse files

fix SSL error

  • Loading branch information
Samweli authored and nyalldawson committed May 4, 2020
1 parent 33cbf25 commit 94106dc2d6c385886d642352b36e756e65def76f
Showing with 41 additions and 7 deletions.
  1. +15 −2 python/plugins/MetaSearch/dialogs/maindialog.py
  2. +26 −5 python/plugins/MetaSearch/ui/maindialog.ui
@@ -51,6 +51,7 @@

from owslib.fes import BBox, PropertyIsLike
from owslib.ows import ExceptionReport
from owslib.util import Authentication

from MetaSearch import link_types
from MetaSearch.dialogs.manageconnectionsdialog import ManageConnectionsDialog
@@ -96,6 +97,7 @@ def __init__(self, iface):
self.startfrom = 0
self.maxrecords = 10
self.timeout = 10
self.disable_ssl = False
self.constraints = []

# Servers tab
@@ -447,6 +449,9 @@ def search(self):
# set timeout
self.timeout = self.spnTimeout.value()

# ssl mode
self.disable_ssl = self.disableSSL.isChecked()

# bbox
# CRS is WGS84 with axis order longitude, latitude
# defined by 'urn:ogc:def:crs:OGC:1.3:CRS84'
@@ -828,9 +833,13 @@ def show_metadata(self):

try:
with OverrideCursor(Qt.WaitCursor):
auth = None
if self.disable_ssl:
auth = Authentication(verify=False)
cat = CatalogueServiceWeb(self.catalog_url, timeout=self.timeout, # spellok
username=self.catalog_username,
password=self.catalog_password)
password=self.catalog_password,
auth=auth)
cat.getrecordbyid(
[self.catalog.records[identifier].identifier])
except ExceptionReport as err:
@@ -907,11 +916,15 @@ def _get_csw(self):

# connect to the server
with OverrideCursor(Qt.WaitCursor):
auth = None
if self.disable_ssl:
auth = Authentication(verify=False)
try:
self.catalog = CatalogueServiceWeb(self.catalog_url, # spellok
timeout=self.timeout,
username=self.catalog_username,
password=self.catalog_password)
password=self.catalog_password,
auth=auth)
return True
except ExceptionReport as err:
msg = self.tr('Error connecting to service: {0}').format(err)
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>656</width>
<width>658</width>
<height>550</height>
</rect>
</property>
@@ -488,23 +488,44 @@
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Server Timeout</string>
<string>Server</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="2">
<widget class="QSpinBox" name="spnTimeout">
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item>
<item row="1" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Disable SSL</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="disableSSL">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_9">
<property name="text">
<string>seconds</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Timeout</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

0 comments on commit 94106dc

Please sign in to comment.
You can’t perform that action at this time.