2001-03-15 01:19:35 +00:00
|
|
|
"""Handle https links"""
|
2001-05-23 21:20:44 +00:00
|
|
|
# Copyright (C) 2000,2001 Bastian Kleineidam
|
2001-03-15 01:19:35 +00:00
|
|
|
#
|
2001-05-23 21:20:44 +00:00
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
2001-03-15 01:19:35 +00:00
|
|
|
#
|
2001-05-23 21:20:44 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
2001-03-15 01:19:35 +00:00
|
|
|
#
|
2001-05-23 21:20:44 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2000-11-11 00:38:04 +00:00
|
|
|
|
2000-02-26 10:24:46 +00:00
|
|
|
from UrlData import UrlData
|
2000-02-29 12:53:00 +00:00
|
|
|
from HttpUrlData import HttpUrlData
|
2000-05-28 23:49:42 +00:00
|
|
|
from linkcheck import _
|
2000-11-09 12:02:38 +00:00
|
|
|
_supportHttps=1
|
|
|
|
|
try: import httpslib
|
|
|
|
|
except ImportError: _supportHttps=0
|
2000-02-29 12:53:00 +00:00
|
|
|
|
|
|
|
|
class HttpsUrlData(HttpUrlData):
|
|
|
|
|
"""Url link with https scheme"""
|
|
|
|
|
|
|
|
|
|
def _getHTTPObject(self, host):
|
2000-11-09 12:02:38 +00:00
|
|
|
return httpslib.HTTPS(host)
|
2000-02-26 10:24:46 +00:00
|
|
|
|
|
|
|
|
def check(self, config):
|
2000-02-29 12:53:00 +00:00
|
|
|
if _supportHttps:
|
|
|
|
|
HttpUrlData.check(self, config)
|
|
|
|
|
else:
|
2000-11-09 12:02:38 +00:00
|
|
|
self.setWarning(_("HTTPS url ignored"))
|
2000-02-29 12:53:00 +00:00
|
|
|
self.logMe(config)
|
|
|
|
|
|
2000-11-02 10:34:22 +00:00
|
|
|
def get_scheme(self):
|
|
|
|
|
return "https"
|