[Glass] Alternatives for HTTPS client

Mariano Martinez Peck marianopeck at gmail.com
Sat Nov 16 15:33:05 PST 2013


On Sat, Nov 16, 2013 at 8:32 PM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:

>
>
>
> On Fri, Nov 15, 2013 at 8:36 PM, John McIntosh <
> johnmci at smalltalkconsulting.com> wrote:
>
>> Let me give an example of where we talk to Apple's App Store Receipt
>> Validation server.
>> That takes a Json stream built from a Dictionary and returns a Json
>> stream we decompose into a Dictionary and validate.
>>
>> We refer to the host as  http://localhost:8889/verifyReceipt'.
>> but the proxy-remapping by apache changes that to
>>
>>  https://buy.itunes.apple.com/verifyReceipt
>>
>> For apache we have
>>
>> <VirtualHost *:8889>
>>   ProxyRequests On
>>   ProxyPass / https://buy.itunes.apple.com/
>>   ProxyPassReverse / https://buy.itunes.apple.com/
>>
>
> Cool. Thanks John for the example, Very useful.
> The only thing I would need is to automatically get this URL from the
> original URL. Otherwise, I would need to add an entry to the conf file for
> each financial institution...and that's  a pain...
>
> Thanks!!
>
>
>
>>   SSLProxyEngine on
>> </VirtualHost>
>>
>> The gemstone code is:
>>
>> url := 'http://localhost:8889/verifyReceipt'.
>>   client := ZnClient new
>>     url: url;
>>     enforceHttpSuccess: true;
>>     accept: ZnMimeType applicationJson;
>>     contentWriter: [ :object |
>>         ZnEntity
>>             with: (String streamContents: [ :stream |
>>                         JSStream encodeDictionary:  object on:  stream  ])
>>             type: ZnMimeType applicationJson ];
>>     contentReader: [ :entity |
>> JSJsonParser parse: entity bytes asString];
>>     yourself.
>>
>> d := Dictionary new.
>> d at: 'receipt-data' put: purchaseData receiptData.
>> d at: 'password' put: 'xxxxxxxxxxx'.
>>
>> client contents: d.
>> results := client post.
>> purchaseData validationData: results.
>>  ^self checkValidationData: purchaseData
>>
>> On Nov 15, 2013, at 1:19 PM, Mariano Martinez Peck <marianopeck at gmail.com>
>> wrote:
>>
>>
>>
>>
>> On Fri, Nov 15, 2013 at 3:05 PM, John M McIntosh <
>> johnmci at smalltalkconsulting.com> wrote:
>>
>>> You can do proxy rewrite redirection from your local http server to the
>>> https server. Thus http://localhost:8776/service/...  Becomes
>>> https://www.apple.com/service...  So https from server to https host
>>> and http from server to zinc
>>>
>>>
>> Hi John, thanks for your suggestion, I was thinking something similar.
>> Can I do this with proxy rewrite redirection??  :
>>
>> From GemStone app, I connect to:
>> http://localhost:8776/specialService/www.aserverthatlistens.com/serviceToCall
>>
>> And that is redirected to:
>>
>> https://www.aserverthatlistens.com/serviceToCall   ?
>>
>> Could that be done with rewrite/redirection rules?
>> Basically, it would be "does url begins with
>> http://localhost:8776/specialService"  if true, then it should be
>> https://  ,  the last part of the original url :)
>>
>> Probably I could experiment a bit (I have a server running in nginx)..
>>
>> Thanks!
>>
>>
>>
>>
>>>
>>> Sent from my iPhone
>>>
>>> On Nov 15, 2013, at 10:28 AM, Mariano Martinez Peck <
>>> marianopeck at gmail.com> wrote:
>>>
>>> Hi guys. I need a HTTPS client to do a post. Actually, my app need to
>>> connect to many "financial institutions" though a protocol. I have a
>>> collection of financial institutions (stored in my database) and each of
>>> them provides the URL I need to connect and do the post. Some are HTTPS
>>> some are HTTP.
>>>
>>> In Pharo, I use Zodiac. The nice thing is that by using ZnClient I can
>>> either connect to HTTP and HTTPS. I do this:
>>>
>>> | client |
>>>  client := ZnClient new.
>>> client
>>> systemPolicy;
>>>  accept: 'application/xxx' asZnMimeType ;
>>> https;
>>> contents: stream contents;
>>>  logToTranscript;
>>> url: aStringURL;
>>> post.
>>>  What are the workarounds I could do in GemStone?
>>>
>>> Thanks in advance,
>>>
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com
>>>
>>> _______________________________________________
>>>
>>> Glass mailing list
>>> Glass at lists.gemtalksystems.com
>>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>>>
>>>
>>
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>>
>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>



-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20131116/e2a7e644/attachment.html>


More information about the Glass mailing list