mirror of
https://github.com/9001/copyparty.git
synced 2025-12-27 10:15:16 -05:00
u2c: fix deprecation + add -teh
This commit is contained in:
@@ -6,8 +6,8 @@ __copyright__ = 2019
|
|||||||
__license__ = "MIT"
|
__license__ = "MIT"
|
||||||
__url__ = "https://github.com/9001/copyparty/"
|
__url__ = "https://github.com/9001/copyparty/"
|
||||||
|
|
||||||
S_VERSION = "2.1"
|
S_VERSION = "2.2"
|
||||||
S_BUILD_DT = "2025-09-06"
|
S_BUILD_DT = "2025-12-16"
|
||||||
|
|
||||||
"""
|
"""
|
||||||
mount a copyparty server (local or remote) as a filesystem
|
mount a copyparty server (local or remote) as a filesystem
|
||||||
@@ -284,8 +284,8 @@ class Gateway(object):
|
|||||||
if ar.td:
|
if ar.td:
|
||||||
self.ssl_context = ssl._create_unverified_context()
|
self.ssl_context = ssl._create_unverified_context()
|
||||||
elif ar.te:
|
elif ar.te:
|
||||||
self.ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS)
|
self.ssl_context = ssl.create_default_context(cafile=ar.te)
|
||||||
self.ssl_context.load_verify_locations(ar.te)
|
self.ssl_context.check_hostname = ar.teh
|
||||||
|
|
||||||
self.conns = {}
|
self.conns = {}
|
||||||
|
|
||||||
@@ -1165,6 +1165,7 @@ NOTE: if server has --usernames enabled, then password is "username:password"
|
|||||||
|
|
||||||
ap2 = ap.add_argument_group("https/TLS")
|
ap2 = ap.add_argument_group("https/TLS")
|
||||||
ap2.add_argument("-te", metavar="PEMFILE", help="certificate to expect/verify")
|
ap2.add_argument("-te", metavar="PEMFILE", help="certificate to expect/verify")
|
||||||
|
ap2.add_argument("-teh", action="store_true", help="require correct hostname in -te cert")
|
||||||
ap2.add_argument("-td", action="store_true", help="disable certificate check")
|
ap2.add_argument("-td", action="store_true", help="disable certificate check")
|
||||||
|
|
||||||
ap2 = ap.add_argument_group("cache/perf")
|
ap2 = ap.add_argument_group("cache/perf")
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from __future__ import print_function, unicode_literals
|
from __future__ import print_function, unicode_literals
|
||||||
|
|
||||||
S_VERSION = "2.16"
|
S_VERSION = "2.17"
|
||||||
S_BUILD_DT = "2025-12-11"
|
S_BUILD_DT = "2025-12-16"
|
||||||
|
|
||||||
"""
|
"""
|
||||||
u2c.py: upload to copyparty
|
u2c.py: upload to copyparty
|
||||||
@@ -165,8 +165,8 @@ class HCli(object):
|
|||||||
elif self.verify is True:
|
elif self.verify is True:
|
||||||
self.ctx = None
|
self.ctx = None
|
||||||
else:
|
else:
|
||||||
self.ctx = ssl.SSLContext(ssl.PROTOCOL_TLS)
|
self.ctx = ssl.create_default_context(cafile=self.verify)
|
||||||
self.ctx.load_verify_locations(self.verify)
|
self.ctx.check_hostname = ar.teh
|
||||||
|
|
||||||
self.base_hdrs = {
|
self.base_hdrs = {
|
||||||
"Accept": "*/*",
|
"Accept": "*/*",
|
||||||
@@ -1593,6 +1593,7 @@ NOTE: if server has --usernames enabled, then password is "username:password"
|
|||||||
|
|
||||||
ap = app.add_argument_group("tls")
|
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("-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")
|
ap.add_argument("-td", action="store_true", help="disable certificate check")
|
||||||
# fmt: on
|
# fmt: on
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user