Parameters for STOMP ssl connections.
initialize returns a valid instance of SSLParams or raises an error.
# File lib/stomp/sslparams.rb, line 44 def initialize(opts={}) # Server authentication parameters @ts_files = opts[:ts_files] # A trust store file, normally a CA's cert # or a CSV list of cert file names # Client authentication parameters @cert_file = opts[:cert_file] # Client cert @key_file = opts[:key_file] # Client key @key_password = opts[:key_password] # Client key password # raise Stomp::Error::SSLClientParamsError if @cert_file.nil? && !@key_file.nil? raise Stomp::Error::SSLClientParamsError if !@cert_file.nil? && @key_file.nil? # @ciphers = opts[:ciphers] @use_ruby_ciphers = opts[:use_ruby_ciphers] ? opts[:use_ruby_ciphers] : false # if opts[:fsck] if @cert_file raise Stomp::Error::SSLNoCertFileError if !File::exists?(@cert_file) raise Stomp::Error::SSLUnreadableCertFileError if !File::readable?(@cert_file) end if @key_file raise Stomp::Error::SSLNoKeyFileError if !File::exists?(@key_file) raise Stomp::Error::SSLUnreadableKeyFileError if !File::readable?(@key_file) end if @ts_files tsa = @ts_files.split(",") tsa.each do |fn| raise Stomp::Error::SSLNoTruststoreFileError if !File::exists?(fn) raise Stomp::Error::SSLUnreadableTruststoreFileError if !File::readable?(fn) end end end end
Generated with the Darkfish Rdoc Generator 2.