| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ce1d6b5 commit 47ef7ca
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -189,8 +189,17 @@ def is_open(self): | |||
| 189 | 189 | return self.monitor.status == Monitor.CONNECTED | |
| 190 | 190 | ||
| 191 | 191 | def _get_ssl(self, cert=None): | |
| 192 | - return ssl.create_default_context( | ||
| 192 | + context = ssl.create_default_context( | ||
| 193 | 193 | purpose=ssl.Purpose.SERVER_AUTH, cadata=cert) | |
| 194 | + if cert: | ||
| 195 | + # Disable hostname checking if and only if we have an explicit cert | ||
| 196 | + # to validate against, because the cert doesn't contain the IP addr | ||
| 197 | + # of the controller, which is what self-bootstrapped controllers | ||
| 198 | + # use. And because we pre-share and trust both the cert and | ||
| 199 | + # endpoint address anyway, it's safe to skip that check. | ||
| 200 | + # See: https://github.com/juju/python-libjuju/issues/302 | ||
| 201 | + context.check_hostname = False | ||
| 202 | + return context | ||
| 194 | 203 | ||
| 195 | 204 | async def _open(self, endpoint, cacert): | |
| 196 | 205 | if self.uuid: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments