Skip to content

Instantly share code, notes, and snippets.

View foxeg's full-sized avatar
🦊

Fokin Evgenii foxeg

🦊
View GitHub Profile
@jnimety
jnimety / implicit_tls_ftp.rb
Last active May 18, 2024 01:14
Ruby Net::FTP Implicit TLS
# Assumes a recent version of ruby with TLS and Explicit TLS support
class ImplicitTlsFTP < Net::FTP
FTP_PORT = 990
def connect(host, port = FTP_PORT)
synchronize do
@host = host
@bare_sock = open_socket(host, port)
begin
ssl_sock = start_tls_session(Socket.tcp(host, port))