MCPcopy Index your code
hub / github.com/RUB-NDS/PRET / https

Method https

capabilities.py:119–133  ·  view source on GitHub ↗
(self, host)

Source from the content-addressed store, hash-verified

117 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
118 # get capabilities via HTTPS
119 def https(self, host):
120 try:
121 # poor man's way get https title
122 sys.stdout.write("Checking for HTTPS support: ")
123 html = requests.get("https://" + host, verify=False).text
124 # cause we are to parsimonious to import BeautifulSoup ;)
125 title = re.findall("<title.*?>\n?(.+?)\n?</title>",
126 html, re.I | re.M | re.S)
127 # get name of device
128 model = item(title)
129 # get language support
130 self.set_support(model)
131 output().green("found")
132 except Exception as e:
133 output().errmsg("not found", e)
134
135 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
136 # get capabilities via SNMP

Callers 1

__init__Method · 0.95

Calls 7

set_supportMethod · 0.95
itemFunction · 0.90
outputClass · 0.90
greenMethod · 0.80
errmsgMethod · 0.80
writeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected