mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue 12139: add CCC command support to FTP_TLS class to revert the SSL connection back to clear-text.
This commit is contained in:
parent
504783975b
commit
096dcb1eff
4 changed files with 47 additions and 2 deletions
|
@ -708,6 +708,14 @@ else:
|
|||
self.file = self.sock.makefile(mode='r', encoding=self.encoding)
|
||||
return resp
|
||||
|
||||
def ccc(self):
|
||||
'''Switch back to a clear-text control connection.'''
|
||||
if not isinstance(self.sock, ssl.SSLSocket):
|
||||
raise ValueError("not using TLS")
|
||||
resp = self.voidcmd('CCC')
|
||||
self.sock = self.sock.unwrap()
|
||||
return resp
|
||||
|
||||
def prot_p(self):
|
||||
'''Set up secure data connection.'''
|
||||
# PROT defines whether or not the data channel is to be protected.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue