Method: Fluent::RelpInput#start

Defined in:
lib/fluent/plugin/in_relp.rb

#startObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/fluent/plugin/in_relp.rb', line 21

def start
	super
	ssl_context = nil
	if @ssl_config != nil
		ssl_context = OpenSSL::SSL::SSLContext.new(:TLSv1_2)
		ssl_context.ca_file = @ssl_config.split(':')[2]
		ssl_context.verify_mode = OpenSSL::SSL::VERIFY_PEER
		ssl_context.key = OpenSSL::PKey::RSA.new(File.open(@ssl_config.split(':')[1]))
		ssl_context.cert = OpenSSL::X509::Certificate.new(File.open(@ssl_config.split(':')[0]))
	end
	@server = Relp::RelpServer.new(@port, method(:on_message), @bind, ssl_context, log)
    @thread = Thread.new(&method(:run))
end