OpenSSL/SOAP - keystore/truststore

Discussion in 'Ruby' started by Christopher Wilson, Mar 5, 2008.

  1. I am attempting to connect to a secure SOAP web service and have been
    provided a password protected keystore, truststore and also a self
    signed *.cer file.

    The server component is implemented in java and the documentation is
    plentiful. While I have been able to use the non-secure service, I am
    not sure how to use the keystore/truststore particularly with password
    protection.

    I realize that this is roughly what is available to me in the ruby lib:

    wsdl = 'https://some.com/something.wsl'
    factory = SOAP::WSDLDriverFactory.new( wsdl )
    drv = factory.create_rpc_driver
    drv.options[ 'protocol.http.ssl_config.ca_file' ] = nil

    alternatively:

    drv.options['protocol.http.ssl_config.verify_mode'] =
    openSSL::SSL::VERIFY_NONE
    #drv.options['protocol.http.ssl_config.verify_mode'] =
    OpenSSL::SSL::VERIFY_PEER
    drv.options['protocol.http.ssl_config.ca_file'] = 'api_cert_chain.crt'
    drv.options['protocol.http.ssl_config.client_cert'] = 'client.cert'
    drv.options['protocol.http.ssl_config.client_key'] = 'client.keys'

    Thanks in advance for any insight.

    Christopher Wilson
     
    Christopher Wilson, Mar 5, 2008
    #1
    1. Advertisements

  2. I'd like to take a string like that below

    "0011122234667889"

    and reduce to

    "012346789"

    I can see ways to do it for a single digit, but
    not all in one fell swoop:

    "0011122234667889".gsub(/1{2,}/, "1") #reduce seq (2 or more) of 1s to
    single 1


    "0011122234667889".gsub(/1+/, "1") #1 or more 1s to single 1

    Thanks for any help.

    Steve
     
    Stephen Fickas, Mar 6, 2008
    #2
    1. Advertisements

  3. My first try would be :

    "0011122234667889".gsub /(\d)\1+/, '\1'

    -- Jean-Fran=E7ois.
     
    Jean-François Trân, Mar 6, 2008
    #3
  4. Christopher Wilson

    James Gray Guest

    How about this?
    => "012346789"

    James Edward Gray II
     
    James Gray, Mar 6, 2008
    #4
  5. Not good.

    irb(main):002:0> "0011122234667889".squeeze
    => "012346789"
     
    William James, Mar 6, 2008
    #5
  6. Christopher Wilson

    James Gray Guest

    I love you too William.

    James Edward Gray II
     
    James Gray, Mar 6, 2008
    #6
  7. Nice. I know, rtfm, right?

    Steve

     
    Stephen Fickas, Mar 6, 2008
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.