u2c: fix deprecation + add -teh

This commit is contained in:
ed
2025-12-16 20:27:55 +00:00
parent db38cb2f79
commit d12cf9aee1
2 changed files with 10 additions and 8 deletions

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env python3
from __future__ import print_function, unicode_literals
S_VERSION = "2.16"
S_BUILD_DT = "2025-12-11"
S_VERSION = "2.17"
S_BUILD_DT = "2025-12-16"
"""
u2c.py: upload to copyparty
@@ -165,8 +165,8 @@ class HCli(object):
elif self.verify is True:
self.ctx = None
else:
self.ctx = ssl.SSLContext(ssl.PROTOCOL_TLS)
self.ctx.load_verify_locations(self.verify)
self.ctx = ssl.create_default_context(cafile=self.verify)
self.ctx.check_hostname = ar.teh
self.base_hdrs = {
"Accept": "*/*",
@@ -1593,6 +1593,7 @@ NOTE: if server has --usernames enabled, then password is "username:password"
ap = app.add_argument_group("tls")
ap.add_argument("-te", metavar="PATH", help="path to ca.pem or cert.pem to expect/verify")
ap.add_argument("-teh", action="store_true", help="require correct hostname in -te cert")
ap.add_argument("-td", action="store_true", help="disable certificate check")
# fmt: on