[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

OpenSSL/SOAP - keystore/truststore

Christopher Wilson

3/5/2008 10:13:00 PM

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/somethin...
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
--
Posted via http://www.ruby-....

6 Answers

Stephen Fickas

3/6/2008 7:02:00 PM

0

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

Jean-François Trân

3/6/2008 7:11:00 PM

0

2008/3/6, Stephen Fickas <fickas@cs.uoregon.edu>:

> 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

My first try would be :

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

-- Jean-Fran=E7ois.

James Gray

3/6/2008 7:13:00 PM

0

On Mar 6, 2008, at 1:01 PM, Stephen Fickas wrote:

> I'd like to take a string like that below
>
> "0011122234667889"
>
> and reduce to
>
> "012346789"

How about this?

>> "0011122234667889".split("").uniq.join
=> "012346789"

James Edward Gray II

William James

3/6/2008 10:36:00 PM

0

On Mar 6, 1:13 pm, James Gray, Junior <ja...@grayproductions.net>
wrote:
> On Mar 6, 2008, at 1:01 PM, Stephen Fickas wrote:
>
> > I'd like to take a string like that below
>
> > "0011122234667889"
>
> > and reduce to
>
> > "012346789"
>
> How about this?
>
> >> "0011122234667889".split("").uniq.join
> => "012346789"

Not good.

irb(main):002:0> "0011122234667889".squeeze
=> "012346789"

>
> James Gray, Junior

James Gray

3/6/2008 11:20:00 PM

0

On Mar 6, 2008, at 4:39 PM, William James wrote:

> On Mar 6, 1:13 pm, James Gray, Junior <ja...@grayproductions.net>
> wrote:
>> On Mar 6, 2008, at 1:01 PM, Stephen Fickas wrote:
>>
>>> I'd like to take a string like that below
>>
>>> "0011122234667889"
>>
>>> and reduce to
>>
>>> "012346789"
>>
>> How about this?
>>
>>>> "0011122234667889".split("").uniq.join
>> => "012346789"
>
> Not good.
>
> irb(main):002:0> "0011122234667889".squeeze
> => "012346789"
>
>> James Gray, Junior

I love you too William.

James Edward Gray II


Stephen Fickas

3/6/2008 11:30:00 PM

0

Nice. I know, rtfm, right?

Steve

William James wrote:
> On Mar 6, 1:13 pm, James Gray, Junior <ja...@grayproductions.net>
> wrote:
>> On Mar 6, 2008, at 1:01 PM, Stephen Fickas wrote:
>>
>>> I'd like to take a string like that below
>>> "0011122234667889"
>>> and reduce to
>>> "012346789"
>> How about this?
>>
>> >> "0011122234667889".split("").uniq.join
>> => "012346789"
>
> Not good.
>
> irb(main):002:0> "0011122234667889".squeeze
> => "012346789"
>
>> James Gray, Junior
>