mirror of
https://github.com/9001/copyparty.git
synced 2025-10-02 14:42:28 -06:00
ftpd: Use implicit FTPS instead of explicit
Implementation found in edbc9ccaaa
Signed-off-by: Hendrik Wolff <hendrik.wolff@agdsn.me>
This commit is contained in:
parent
52438bcc0d
commit
b56961e621
|
@ -552,6 +552,16 @@ try:
|
|||
class SftpHandler(FtpHandler, TLS_FTPHandler):
|
||||
pass
|
||||
|
||||
class FtpsImplicitHandler(FtpHandler, TLS_FTPHandler):
|
||||
def handle(self):
|
||||
self.secure_connection(self.ssl_context)
|
||||
|
||||
def handle_ssl_established(self):
|
||||
FtpHandler.handle(self)
|
||||
|
||||
def ftp_AUTH(self, arg):
|
||||
self.respond("550 not supposed to be used with implicit SSL.")
|
||||
|
||||
except:
|
||||
pass
|
||||
|
||||
|
@ -566,7 +576,7 @@ class Ftpd(object):
|
|||
hs.append([FtpHandler, self.args.ftp])
|
||||
if self.args.ftps:
|
||||
try:
|
||||
h1 = SftpHandler
|
||||
h1 = FtpsImplicitHandler
|
||||
except:
|
||||
t = "\nftps requires pyopenssl;\nplease run the following:\n\n {} -m pip install --user pyopenssl\n"
|
||||
print(t.format(pybin))
|
||||
|
|
Loading…
Reference in a new issue