13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/lobstersbot/summer_patches.rb', line 13
def connect!
@connection = TCPSocket.open(server, port)
if config[:use_ssl]
cert_file = File.read(config_dir('client.pem'))
context = OpenSSL::SSL::SSLContext.new
context.key = OpenSSL::PKey.read(cert_file)
context.cert = OpenSSL::X509::Certificate.new(cert_file)
@connection = OpenSSL::SSL::SSLSocket.new(@connection, context).connect
end
response("USER #{config[:nick]} #{config[:nick]} #{config[:nick]} #{config[:nick]}")
response("NICK #{config[:nick]}")
end
|