Skip to content

Commit 49dc9d2

Browse files
authored
Merge pull request #139 from netgab/138-iosxe-cert-verify
Closes #138 IOS-XE certificate validation
2 parents 20e4137 + 96041d9 commit 49dc9d2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
--------------------------------------------------------------------------------
2+
Fix
3+
--------------------------------------------------------------------------------
4+
* iosxe
5+
* Modified ``Implementation(RestImplementation)``:
6+
* Added the option to control certificate validation to the device connection, using the ``verify`` parameter (issue #138).

src/rest/connector/libs/iosxe/implementation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ def connect(self,
9696
log.debug("Timeout: %s" % timeout)
9797
self.content_type = default_content_type
9898

99+
self.verify = self.connection_info.get('verify', True)
99100
# support sshtunnel
100101
if 'sshtunnel' in self.connection_info:
101102
try:
@@ -136,6 +137,7 @@ def connect(self,
136137

137138
self.session = requests.Session()
138139
self.session.auth = (username, password)
140+
self.session.verify = self.verify
139141

140142
header = 'application/yang-data+{fmt}'
141143

@@ -150,7 +152,7 @@ def connect(self,
150152

151153
# Connect to the device via requests
152154
response = self.session.get(
153-
login_url, proxies=self.proxies, timeout=timeout, verify=False)
155+
login_url, proxies=self.proxies, timeout=timeout)
154156
output = response.text
155157
log.debug("Response: {c} {r}, headers: {h}, payload {p}".format(
156158
c=response.status_code,

0 commit comments

Comments
 (0)