MacOS and TLSv1.2

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

MacOS and TLSv1.2

Steffan A. Cline
For those of you needing support for TLSv1.2 on a Mac with Lasso 8.6, there a couple things you’ll need to do.

Lasso compiled in it’s support of TLS to the standard at the time on each platform. On the Mac, that was 1.0.

I recently wrote this drop in replacement for include_url which offers all the same options as the default built-in version. I had someone using PayPal tags that used include_url on a Mac using 8.6. I suppose for any libraries you’re using that require include_url and TLSv1.2, this might work fine for you. First they had to upgrade to a newer version of macOS that supported TLS 1.2. The following tag is not as fast as the built in but depending on what you’re doing the milliseconds may be negligible for you. Change the namespace to suit your needs. I used _page_ as not to override the default version for everything on the instance. I used an include for the code which worked flawlessly for our needs. I did add an extra option which allows you to specify more flags to CURL somewhat like the L9 version does.

This code is FREE and no warranty of any kind is implied or written. Use at your own risk. If you enhance or modify it, please let me know so I can include them in any other sharing.

[
        // [include_url()] drop-in replacement.
        // Include atop any page you want to override the built in.
        // Will not override globally unless put in LassoStartup and removal of the namespace.
        // Utilizes os_process to access the OS's built in CURL which is newer than the built in.
        // See the Lasso User Guide for parameter details.
        // Added the option -ExtraOptions. Requires an array of flags/switches
        // Written by Steffan Cline 6/25/2018.
        define_tag('include_url',
                                //-priority='replace',
                                -namespace='_page_');
               
                //elementary error checking
                fail_if(params->size==0 || params->first == null,-1,'[include_url] requires a URL to process.');
               
                //takes an array of pairs or map and turns it into a url encoded list of parameters
                define_tag('params_to_url');
                        if(params->size==1 && params->first->isa('string'));
                                return(encode_url(params->first));
                        /if;
                        local('out'=string,'this_item');
                        iterate(params->first,#this_item);
                                if(#this_item->isa('string'));
                                        #out->append(encode_url(#this_item) + '&');
                                else;
                                        #out->append(encode_url(#this_item->first) + '=' + encode_url(#this_item->second) + '&');
                                /if;
                        /iterate;
                        return(@#out->removetrailing('&')&);
                /define_tag;

                local( 'base_url' = params->first, //the first unnamed parameter will be the URL
                                'user' = (local('username')||'anonymous'), //ensure there is always a username
                                'pass' = (local('password')||'anonymous'), //ensure there is always a password
                                'command'='/usr/bin/curl', //full path to the curl binary
                                'result' = string, //container for our results
                                'stdErr' = string, //container for errors
                                'flags' = array('-L','--tlsv1.2') //ensure we are using the highest TLS for PayPal or Authorize.net. -L required to handle reidrects
                                );
       
                //All lasso options are supported in this dropin replacement
                local_defined('Timeout') ? #flags->insert('--max-time') & insert(integer(#timeout==0 ? 360 | #timeout));
                local_defined('ConnectTimeout') ? #flags->insert('--connect-timeout') & insert(integer(#connecttimeout == 0 ? 360 | #connecttimeout));
                local_defined('PostParams') ? #flags->insert('--data-raw') & insert(params_to_url(#postparams)) & insert('-X') & insert('POST');
                local_defined('GetParams') ? #flags->insert('--data-raw') & insert(params_to_url(#postparams)) & insert('-X') & insert('GET');
                local_defined('Username') || local_defined('Password') ? #flags->insert('-u') & insert(#user->trim& + ':' + #pass->trim&);
                local_defined('VerifyPeer') && #VerifyPeer == false ? #flags->insert('-k');
                local_defined('SSLCert') ? #flags->insert('--cert') & insert(#sslcert);
                local_defined('SSLCertType') && 'PEM|DER|ENG'->contains(#sslcerttype) ? #flags->insert('--cert-type') & insert(#sslcerttype);
                local_defined('SSLKey') ? #flags->insert('--key') & insert(#sslkey);
                local_defined('SSLKeyType') ? #flags->insert('--key-type') & insert(#sslkeytype);
                local_defined('SSLKeyPasswd') ? #flags->insert('--pass') & insert(#sslkeypasswd);
               
                local_defined('RetrieveMIMEHeaders') ? #flags->insert('-D') & insert('-');
                if(local_defined('SendMIMEHeaders'));
                        iterate(#SendMIMEHeaders,local('this_header'));
                                #flags->insert('-H') & insert(#this_header->first->trim& + ': ' + #this_header->second->trim&);
                        /iterate;
                /if;

                if(local_defined('ExtraOptions') && #extraoptions->isa('array'));
                        iterate(#extraoptions,local('this_flag'));
                                #flags->insert(#this_flag->trim&);
                        /iterate;
                /if;

                //this has to be the last parameter in the array so it's at the end of the flags
                #flags->insert(#base_url);

                //launch the curl process with our flags
                local('myProcess' = os_process(#command,#flags));
                #result=#myProcess->read;
                #stdErr=#myProcess->ReadError;
                #myProcess->close;
               
                //if there are any errors returned from the process, log the errors so we can debug if necessary. log location subjective to Lasso Admin settings.
                #stdErr->size ? log_detail('[Include_URL] Drop-In params ' + #flags + ' yielded stdErr message: ' + #stdErr);
               
                //parse out the headers returned into the variable name provided. This goes with the same flag above RetrieveMIMEHeaders
                if(local_defined('RetrieveMIMEHeaders'));
                        local('parts'=#result->split('\r\n'));
                        #result=#parts->last;
                        #parts->removelast;
                        var(#RetrieveMIMEHeaders) = #parts->join('\r\n');
                /if;
               
                //handle the nodata option and added a -string option from Lasso 9 to output as a string. Defaults to bytes output
                return(local_defined('nodata') ? string | (local_defined('string') ? @#result->exportstring('UTF-8’) | @#result));
        /define_tag;
]



Steffan A. Cline
[hidden email]
602-793-0014





#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MacOS and TLSv1.2

Bil Corry-3
Nice!  Thanks!

- Bil

On Tue, Jul 3, 2018 at 10:44 AM, Steffan A. Cline <[hidden email]> wrote:

> For those of you needing support for TLSv1.2 on a Mac with Lasso 8.6,
> there a couple things you’ll need to do.
>
> Lasso compiled in it’s support of TLS to the standard at the time on each
> platform. On the Mac, that was 1.0.
>
> I recently wrote this drop in replacement for include_url which offers all
> the same options as the default built-in version. I had someone using
> PayPal tags that used include_url on a Mac using 8.6. I suppose for any
> libraries you’re using that require include_url and TLSv1.2, this might
> work fine for you. First they had to upgrade to a newer version of macOS
> that supported TLS 1.2. The following tag is not as fast as the built in
> but depending on what you’re doing the milliseconds may be negligible for
> you. Change the namespace to suit your needs. I used _page_ as not to
> override the default version for everything on the instance. I used an
> include for the code which worked flawlessly for our needs. I did add an
> extra option which allows you to specify more flags to CURL somewhat like
> the L9 version does.
>
> This code is FREE and no warranty of any kind is implied or written. Use
> at your own risk. If you enhance or modify it, please let me know so I can
> include them in any other sharing.
>
> [
>         // [include_url()] drop-in replacement.
>         // Include atop any page you want to override the built in.
>         // Will not override globally unless put in LassoStartup and
> removal of the namespace.
>         // Utilizes os_process to access the OS's built in CURL which is
> newer than the built in.
>         // See the Lasso User Guide for parameter details.
>         // Added the option -ExtraOptions. Requires an array of
> flags/switches
>         // Written by Steffan Cline 6/25/2018.
>         define_tag('include_url',
>                                 //-priority='replace',
>                                 -namespace='_page_');
>
>                 //elementary error checking
>                 fail_if(params->size==0 || params->first ==
> null,-1,'[include_url] requires a URL to process.');
>
>                 //takes an array of pairs or map and turns it into a url
> encoded list of parameters
>                 define_tag('params_to_url');
>                         if(params->size==1 &&
> params->first->isa('string'));
>                                 return(encode_url(params->first));
>                         /if;
>                         local('out'=string,'this_item');
>                         iterate(params->first,#this_item);
>                                 if(#this_item->isa('string'));
>                                         #out->append(encode_url(#this_item)
> + '&');
>                                 else;
>                                         #out->append(encode_url(#this_item->first)
> + '=' + encode_url(#this_item->second) + '&');
>                                 /if;
>                         /iterate;
>                         return(@#out->removetrailing('&')&);
>                 /define_tag;
>
>                 local(  'base_url' = params->first,
>              //the first unnamed parameter will be the URL
>                                 'user' = (local('username')||'anonymous'),
>     //ensure there is always a username
>                                 'pass' = (local('password')||'anonymous'),
>     //ensure there is always a password
>                                 'command'='/usr/bin/curl',
>                       //full path to the curl binary
>                                 'result' = string,
>                               //container for our results
>                                 'stdErr' = string,
>                               //container for errors
>                                 'flags' = array('-L','--tlsv1.2')
>  //ensure we are using the highest TLS for PayPal or Authorize.net. -L
> required to handle reidrects
>                                 );
>
>                 //All lasso options are supported in this dropin
> replacement
>                 local_defined('Timeout') ? #flags->insert('--max-time') &
> insert(integer(#timeout==0 ? 360 | #timeout));
>                 local_defined('ConnectTimeout') ?
> #flags->insert('--connect-timeout') & insert(integer(#connecttimeout == 0
> ? 360 | #connecttimeout));
>                 local_defined('PostParams') ? #flags->insert('--data-raw')
> & insert(params_to_url(#postparams)) & insert('-X') & insert('POST');
>                 local_defined('GetParams') ? #flags->insert('--data-raw')
> & insert(params_to_url(#postparams)) & insert('-X') & insert('GET');
>                 local_defined('Username') || local_defined('Password') ?
> #flags->insert('-u') & insert(#user->trim& + ':' + #pass->trim&);
>                 local_defined('VerifyPeer') && #VerifyPeer == false ?
> #flags->insert('-k');
>                 local_defined('SSLCert') ? #flags->insert('--cert') &
> insert(#sslcert);
>                 local_defined('SSLCertType') && 'PEM|DER|ENG'->contains(#sslcerttype)
> ? #flags->insert('--cert-type') & insert(#sslcerttype);
>                 local_defined('SSLKey') ? #flags->insert('--key') &
> insert(#sslkey);
>                 local_defined('SSLKeyType') ? #flags->insert('--key-type')
> & insert(#sslkeytype);
>                 local_defined('SSLKeyPasswd') ? #flags->insert('--pass') &
> insert(#sslkeypasswd);
>
>                 local_defined('RetrieveMIMEHeaders') ?
> #flags->insert('-D') & insert('-');
>                 if(local_defined('SendMIMEHeaders'));
>                         iterate(#SendMIMEHeaders,local('this_header'));
>                                 #flags->insert('-H') &
> insert(#this_header->first->trim& + ': ' + #this_header->second->trim&);
>                         /iterate;
>                 /if;
>
>                 if(local_defined('ExtraOptions') &&
> #extraoptions->isa('array'));
>                         iterate(#extraoptions,local('this_flag'));
>                                 #flags->insert(#this_flag->trim&);
>                         /iterate;
>                 /if;
>
>                 //this has to be the last parameter in the array so it's
> at the end of the flags
>                 #flags->insert(#base_url);
>
>                 //launch the curl process with our flags
>                 local('myProcess' = os_process(#command,#flags));
>                 #result=#myProcess->read;
>                 #stdErr=#myProcess->ReadError;
>                 #myProcess->close;
>
>                 //if there are any errors returned from the process, log
> the errors so we can debug if necessary. log location subjective to Lasso
> Admin settings.
>                 #stdErr->size ? log_detail('[Include_URL] Drop-In params '
> + #flags + ' yielded stdErr message: ' + #stdErr);
>
>                 //parse out the headers returned into the variable name
> provided. This goes with the same flag above RetrieveMIMEHeaders
>                 if(local_defined('RetrieveMIMEHeaders'));
>                         local('parts'=#result->split('\r\n'));
>                         #result=#parts->last;
>                         #parts->removelast;
>                         var(#RetrieveMIMEHeaders) = #parts->join('\r\n');
>
>                 /if;
>
>                 //handle the nodata option and added a -string option from
> Lasso 9 to output as a string. Defaults to bytes output
>                 return(local_defined('nodata') ? string |
> (local_defined('string') ? @#result->exportstring('UTF-8’) | @#result));
>         /define_tag;
> ]
>
>
>
> Steffan A. Cline
> [hidden email]
> 602-793-0014
>
>
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MacOS and TLSv1.2

Steffan A. Cline
Thank you. The idea was to be able to drop it in wherever needed without a need to change even one line of your original code.

Steffan A. Cline
[hidden email]
602-793-0014




> On Jul 3, 2018, at 11:09 AM, Bil Corry <[hidden email]> wrote:
>
> Nice!  Thanks!
>
> - Bil
>
> On Tue, Jul 3, 2018 at 10:44 AM, Steffan A. Cline <[hidden email]> wrote:
>
>> For those of you needing support for TLSv1.2 on a Mac with Lasso 8.6,
>> there a couple things you’ll need to do.
>>
>> Lasso compiled in it’s support of TLS to the standard at the time on each
>> platform. On the Mac, that was 1.0.
>>
>> I recently wrote this drop in replacement for include_url which offers all
>> the same options as the default built-in version. I had someone using
>> PayPal tags that used include_url on a Mac using 8.6. I suppose for any
>> libraries you’re using that require include_url and TLSv1.2, this might
>> work fine for you. First they had to upgrade to a newer version of macOS
>> that supported TLS 1.2. The following tag is not as fast as the built in
>> but depending on what you’re doing the milliseconds may be negligible for
>> you. Change the namespace to suit your needs. I used _page_ as not to
>> override the default version for everything on the instance. I used an
>> include for the code which worked flawlessly for our needs. I did add an
>> extra option which allows you to specify more flags to CURL somewhat like
>> the L9 version does.
>>
>> This code is FREE and no warranty of any kind is implied or written. Use
>> at your own risk. If you enhance or modify it, please let me know so I can
>> include them in any other sharing.
>>
>> [
>>        // [include_url()] drop-in replacement.
>>        // Include atop any page you want to override the built in.
>>        // Will not override globally unless put in LassoStartup and
>> removal of the namespace.
>>        // Utilizes os_process to access the OS's built in CURL which is
>> newer than the built in.
>>        // See the Lasso User Guide for parameter details.
>>        // Added the option -ExtraOptions. Requires an array of
>> flags/switches
>>        // Written by Steffan Cline 6/25/2018.
>>        define_tag('include_url',
>>                                //-priority='replace',
>>                                -namespace='_page_');
>>
>>                //elementary error checking
>>                fail_if(params->size==0 || params->first ==
>> null,-1,'[include_url] requires a URL to process.');
>>
>>                //takes an array of pairs or map and turns it into a url
>> encoded list of parameters
>>                define_tag('params_to_url');
>>                        if(params->size==1 &&
>> params->first->isa('string'));
>>                                return(encode_url(params->first));
>>                        /if;
>>                        local('out'=string,'this_item');
>>                        iterate(params->first,#this_item);
>>                                if(#this_item->isa('string'));
>>                                        #out->append(encode_url(#this_item)
>> + '&');
>>                                else;
>>                                        #out->append(encode_url(#this_item->first)
>> + '=' + encode_url(#this_item->second) + '&');
>>                                /if;
>>                        /iterate;
>>                        return(@#out->removetrailing('&')&);
>>                /define_tag;
>>
>>                local(  'base_url' = params->first,
>>             //the first unnamed parameter will be the URL
>>                                'user' = (local('username')||'anonymous'),
>>    //ensure there is always a username
>>                                'pass' = (local('password')||'anonymous'),
>>    //ensure there is always a password
>>                                'command'='/usr/bin/curl',
>>                      //full path to the curl binary
>>                                'result' = string,
>>                              //container for our results
>>                                'stdErr' = string,
>>                              //container for errors
>>                                'flags' = array('-L','--tlsv1.2')
>> //ensure we are using the highest TLS for PayPal or Authorize.net. -L
>> required to handle reidrects
>>                                );
>>
>>                //All lasso options are supported in this dropin
>> replacement
>>                local_defined('Timeout') ? #flags->insert('--max-time') &
>> insert(integer(#timeout==0 ? 360 | #timeout));
>>                local_defined('ConnectTimeout') ?
>> #flags->insert('--connect-timeout') & insert(integer(#connecttimeout == 0
>> ? 360 | #connecttimeout));
>>                local_defined('PostParams') ? #flags->insert('--data-raw')
>> & insert(params_to_url(#postparams)) & insert('-X') & insert('POST');
>>                local_defined('GetParams') ? #flags->insert('--data-raw')
>> & insert(params_to_url(#postparams)) & insert('-X') & insert('GET');
>>                local_defined('Username') || local_defined('Password') ?
>> #flags->insert('-u') & insert(#user->trim& + ':' + #pass->trim&);
>>                local_defined('VerifyPeer') && #VerifyPeer == false ?
>> #flags->insert('-k');
>>                local_defined('SSLCert') ? #flags->insert('--cert') &
>> insert(#sslcert);
>>                local_defined('SSLCertType') && 'PEM|DER|ENG'->contains(#sslcerttype)
>> ? #flags->insert('--cert-type') & insert(#sslcerttype);
>>                local_defined('SSLKey') ? #flags->insert('--key') &
>> insert(#sslkey);
>>                local_defined('SSLKeyType') ? #flags->insert('--key-type')
>> & insert(#sslkeytype);
>>                local_defined('SSLKeyPasswd') ? #flags->insert('--pass') &
>> insert(#sslkeypasswd);
>>
>>                local_defined('RetrieveMIMEHeaders') ?
>> #flags->insert('-D') & insert('-');
>>                if(local_defined('SendMIMEHeaders'));
>>                        iterate(#SendMIMEHeaders,local('this_header'));
>>                                #flags->insert('-H') &
>> insert(#this_header->first->trim& + ': ' + #this_header->second->trim&);
>>                        /iterate;
>>                /if;
>>
>>                if(local_defined('ExtraOptions') &&
>> #extraoptions->isa('array'));
>>                        iterate(#extraoptions,local('this_flag'));
>>                                #flags->insert(#this_flag->trim&);
>>                        /iterate;
>>                /if;
>>
>>                //this has to be the last parameter in the array so it's
>> at the end of the flags
>>                #flags->insert(#base_url);
>>
>>                //launch the curl process with our flags
>>                local('myProcess' = os_process(#command,#flags));
>>                #result=#myProcess->read;
>>                #stdErr=#myProcess->ReadError;
>>                #myProcess->close;
>>
>>                //if there are any errors returned from the process, log
>> the errors so we can debug if necessary. log location subjective to Lasso
>> Admin settings.
>>                #stdErr->size ? log_detail('[Include_URL] Drop-In params '
>> + #flags + ' yielded stdErr message: ' + #stdErr);
>>
>>                //parse out the headers returned into the variable name
>> provided. This goes with the same flag above RetrieveMIMEHeaders
>>                if(local_defined('RetrieveMIMEHeaders'));
>>                        local('parts'=#result->split('\r\n'));
>>                        #result=#parts->last;
>>                        #parts->removelast;
>>                        var(#RetrieveMIMEHeaders) = #parts->join('\r\n');
>>
>>                /if;
>>
>>                //handle the nodata option and added a -string option from
>> Lasso 9 to output as a string. Defaults to bytes output
>>                return(local_defined('nodata') ? string |
>> (local_defined('string') ? @#result->exportstring('UTF-8’) | @#result));
>>        /define_tag;
>> ]
>>
>>
>>
>> Steffan A. Cline
>> [hidden email]
>> 602-793-0014
>>
>>
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MacOS and TLSv1.2

Laurent Gigon
I've tried that include, here is the error code :

Expected: a tag name but got: "//handle the nodata option and added a
-string option from Lasso 9 to output as a string. Defaults to bytes
output ...
at: Unterminated quoted literal on line 87 at position 17.
Container was not closed. "define_tag"
at: /admin/TLSv1.2.lasso on line 9 at position 9.

Laurent

2018-07-03 14:13 GMT-04:00 Steffan A. Cline <[hidden email]>:

> Thank you. The idea was to be able to drop it in wherever needed without a need to change even one line of your original code.
>
> Steffan A. Cline
> [hidden email]
> 602-793-0014
>
>
>
>
>> On Jul 3, 2018, at 11:09 AM, Bil Corry <[hidden email]> wrote:
>>
>> Nice!  Thanks!
>>
>> - Bil
>>
>> On Tue, Jul 3, 2018 at 10:44 AM, Steffan A. Cline <[hidden email]> wrote:
>>
>>> For those of you needing support for TLSv1.2 on a Mac with Lasso 8.6,
>>> there a couple things you’ll need to do.
>>>
>>> Lasso compiled in it’s support of TLS to the standard at the time on each
>>> platform. On the Mac, that was 1.0.
>>>
>>> I recently wrote this drop in replacement for include_url which offers all
>>> the same options as the default built-in version. I had someone using
>>> PayPal tags that used include_url on a Mac using 8.6. I suppose for any
>>> libraries you’re using that require include_url and TLSv1.2, this might
>>> work fine for you. First they had to upgrade to a newer version of macOS
>>> that supported TLS 1.2. The following tag is not as fast as the built in
>>> but depending on what you’re doing the milliseconds may be negligible for
>>> you. Change the namespace to suit your needs. I used _page_ as not to
>>> override the default version for everything on the instance. I used an
>>> include for the code which worked flawlessly for our needs. I did add an
>>> extra option which allows you to specify more flags to CURL somewhat like
>>> the L9 version does.
>>>
>>> This code is FREE and no warranty of any kind is implied or written. Use
>>> at your own risk. If you enhance or modify it, please let me know so I can
>>> include them in any other sharing.
>>>
>>> [
>>>        // [include_url()] drop-in replacement.
>>>        // Include atop any page you want to override the built in.
>>>        // Will not override globally unless put in LassoStartup and
>>> removal of the namespace.
>>>        // Utilizes os_process to access the OS's built in CURL which is
>>> newer than the built in.
>>>        // See the Lasso User Guide for parameter details.
>>>        // Added the option -ExtraOptions. Requires an array of
>>> flags/switches
>>>        // Written by Steffan Cline 6/25/2018.
>>>        define_tag('include_url',
>>>                                //-priority='replace',
>>>                                -namespace='_page_');
>>>
>>>                //elementary error checking
>>>                fail_if(params->size==0 || params->first ==
>>> null,-1,'[include_url] requires a URL to process.');
>>>
>>>                //takes an array of pairs or map and turns it into a url
>>> encoded list of parameters
>>>                define_tag('params_to_url');
>>>                        if(params->size==1 &&
>>> params->first->isa('string'));
>>>                                return(encode_url(params->first));
>>>                        /if;
>>>                        local('out'=string,'this_item');
>>>                        iterate(params->first,#this_item);
>>>                                if(#this_item->isa('string'));
>>>                                        #out->append(encode_url(#this_item)
>>> + '&');
>>>                                else;
>>>                                        #out->append(encode_url(#this_item->first)
>>> + '=' + encode_url(#this_item->second) + '&');
>>>                                /if;
>>>                        /iterate;
>>>                        return(@#out->removetrailing('&')&);
>>>                /define_tag;
>>>
>>>                local(  'base_url' = params->first,
>>>             //the first unnamed parameter will be the URL
>>>                                'user' = (local('username')||'anonymous'),
>>>    //ensure there is always a username
>>>                                'pass' = (local('password')||'anonymous'),
>>>    //ensure there is always a password
>>>                                'command'='/usr/bin/curl',
>>>                      //full path to the curl binary
>>>                                'result' = string,
>>>                              //container for our results
>>>                                'stdErr' = string,
>>>                              //container for errors
>>>                                'flags' = array('-L','--tlsv1.2')
>>> //ensure we are using the highest TLS for PayPal or Authorize.net. -L
>>> required to handle reidrects
>>>                                );
>>>
>>>                //All lasso options are supported in this dropin
>>> replacement
>>>                local_defined('Timeout') ? #flags->insert('--max-time') &
>>> insert(integer(#timeout==0 ? 360 | #timeout));
>>>                local_defined('ConnectTimeout') ?
>>> #flags->insert('--connect-timeout') & insert(integer(#connecttimeout == 0
>>> ? 360 | #connecttimeout));
>>>                local_defined('PostParams') ? #flags->insert('--data-raw')
>>> & insert(params_to_url(#postparams)) & insert('-X') & insert('POST');
>>>                local_defined('GetParams') ? #flags->insert('--data-raw')
>>> & insert(params_to_url(#postparams)) & insert('-X') & insert('GET');
>>>                local_defined('Username') || local_defined('Password') ?
>>> #flags->insert('-u') & insert(#user->trim& + ':' + #pass->trim&);
>>>                local_defined('VerifyPeer') && #VerifyPeer == false ?
>>> #flags->insert('-k');
>>>                local_defined('SSLCert') ? #flags->insert('--cert') &
>>> insert(#sslcert);
>>>                local_defined('SSLCertType') && 'PEM|DER|ENG'->contains(#sslcerttype)
>>> ? #flags->insert('--cert-type') & insert(#sslcerttype);
>>>                local_defined('SSLKey') ? #flags->insert('--key') &
>>> insert(#sslkey);
>>>                local_defined('SSLKeyType') ? #flags->insert('--key-type')
>>> & insert(#sslkeytype);
>>>                local_defined('SSLKeyPasswd') ? #flags->insert('--pass') &
>>> insert(#sslkeypasswd);
>>>
>>>                local_defined('RetrieveMIMEHeaders') ?
>>> #flags->insert('-D') & insert('-');
>>>                if(local_defined('SendMIMEHeaders'));
>>>                        iterate(#SendMIMEHeaders,local('this_header'));
>>>                                #flags->insert('-H') &
>>> insert(#this_header->first->trim& + ': ' + #this_header->second->trim&);
>>>                        /iterate;
>>>                /if;
>>>
>>>                if(local_defined('ExtraOptions') &&
>>> #extraoptions->isa('array'));
>>>                        iterate(#extraoptions,local('this_flag'));
>>>                                #flags->insert(#this_flag->trim&);
>>>                        /iterate;
>>>                /if;
>>>
>>>                //this has to be the last parameter in the array so it's
>>> at the end of the flags
>>>                #flags->insert(#base_url);
>>>
>>>                //launch the curl process with our flags
>>>                local('myProcess' = os_process(#command,#flags));
>>>                #result=#myProcess->read;
>>>                #stdErr=#myProcess->ReadError;
>>>                #myProcess->close;
>>>
>>>                //if there are any errors returned from the process, log
>>> the errors so we can debug if necessary. log location subjective to Lasso
>>> Admin settings.
>>>                #stdErr->size ? log_detail('[Include_URL] Drop-In params '
>>> + #flags + ' yielded stdErr message: ' + #stdErr);
>>>
>>>                //parse out the headers returned into the variable name
>>> provided. This goes with the same flag above RetrieveMIMEHeaders
>>>                if(local_defined('RetrieveMIMEHeaders'));
>>>                        local('parts'=#result->split('\r\n'));
>>>                        #result=#parts->last;
>>>                        #parts->removelast;
>>>                        var(#RetrieveMIMEHeaders) = #parts->join('\r\n');
>>>
>>>                /if;
>>>
>>>                //handle the nodata option and added a -string option from
>>> Lasso 9 to output as a string. Defaults to bytes output
>>>                return(local_defined('nodata') ? string |
>>> (local_defined('string') ? @#result->exportstring('UTF-8’) | @#result));
>>>        /define_tag;
>>> ]
>>>
>>>
>>>
>>> Steffan A. Cline
>>> [hidden email]
>>> 602-793-0014
>>>
>>>
>>>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>>  the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MacOS and TLSv1.2

Steffan A. Cline
Sounds like something was encoded wrong in the email. Look for smart quotes. If it still doesn’t work, I’ll email the file directly.

Thanks,
Steffan Cline
[hidden email]
602-793-0014

> On Jul 3, 2018, at 6:14 PM, Laurent G <[hidden email]> wrote:
>
> I've tried that include, here is the error code :
>
> Expected: a tag name but got: "//handle the nodata option and added a
> -string option from Lasso 9 to output as a string. Defaults to bytes
> output ...
> at: Unterminated quoted literal on line 87 at position 17.
> Container was not closed. "define_tag"
> at: /admin/TLSv1.2.lasso on line 9 at position 9.
>
> Laurent
>
> 2018-07-03 14:13 GMT-04:00 Steffan A. Cline <[hidden email]>:
>> Thank you. The idea was to be able to drop it in wherever needed without a need to change even one line of your original code.
>>
>> Steffan A. Cline
>> [hidden email]
>> 602-793-0014
>>
>>
>>
>>
>>> On Jul 3, 2018, at 11:09 AM, Bil Corry <[hidden email]> wrote:
>>>
>>> Nice!  Thanks!
>>>
>>> - Bil
>>>
>>>> On Tue, Jul 3, 2018 at 10:44 AM, Steffan A. Cline <[hidden email]> wrote:
>>>>
>>>> For those of you needing support for TLSv1.2 on a Mac with Lasso 8.6,
>>>> there a couple things you’ll need to do.
>>>>
>>>> Lasso compiled in it’s support of TLS to the standard at the time on each
>>>> platform. On the Mac, that was 1.0.
>>>>
>>>> I recently wrote this drop in replacement for include_url which offers all
>>>> the same options as the default built-in version. I had someone using
>>>> PayPal tags that used include_url on a Mac using 8.6. I suppose for any
>>>> libraries you’re using that require include_url and TLSv1.2, this might
>>>> work fine for you. First they had to upgrade to a newer version of macOS
>>>> that supported TLS 1.2. The following tag is not as fast as the built in
>>>> but depending on what you’re doing the milliseconds may be negligible for
>>>> you. Change the namespace to suit your needs. I used _page_ as not to
>>>> override the default version for everything on the instance. I used an
>>>> include for the code which worked flawlessly for our needs. I did add an
>>>> extra option which allows you to specify more flags to CURL somewhat like
>>>> the L9 version does.
>>>>
>>>> This code is FREE and no warranty of any kind is implied or written. Use
>>>> at your own risk. If you enhance or modify it, please let me know so I can
>>>> include them in any other sharing.
>>>>
>>>> [
>>>>       // [include_url()] drop-in replacement.
>>>>       // Include atop any page you want to override the built in.
>>>>       // Will not override globally unless put in LassoStartup and
>>>> removal of the namespace.
>>>>       // Utilizes os_process to access the OS's built in CURL which is
>>>> newer than the built in.
>>>>       // See the Lasso User Guide for parameter details.
>>>>       // Added the option -ExtraOptions. Requires an array of
>>>> flags/switches
>>>>       // Written by Steffan Cline 6/25/2018.
>>>>       define_tag('include_url',
>>>>                               //-priority='replace',
>>>>                               -namespace='_page_');
>>>>
>>>>               //elementary error checking
>>>>               fail_if(params->size==0 || params->first ==
>>>> null,-1,'[include_url] requires a URL to process.');
>>>>
>>>>               //takes an array of pairs or map and turns it into a url
>>>> encoded list of parameters
>>>>               define_tag('params_to_url');
>>>>                       if(params->size==1 &&
>>>> params->first->isa('string'));
>>>>                               return(encode_url(params->first));
>>>>                       /if;
>>>>                       local('out'=string,'this_item');
>>>>                       iterate(params->first,#this_item);
>>>>                               if(#this_item->isa('string'));
>>>>                                       #out->append(encode_url(#this_item)
>>>> + '&');
>>>>                               else;
>>>>                                       #out->append(encode_url(#this_item->first)
>>>> + '=' + encode_url(#this_item->second) + '&');
>>>>                               /if;
>>>>                       /iterate;
>>>>                       return(@#out->removetrailing('&')&);
>>>>               /define_tag;
>>>>
>>>>               local(  'base_url' = params->first,
>>>>            //the first unnamed parameter will be the URL
>>>>                               'user' = (local('username')||'anonymous'),
>>>>   //ensure there is always a username
>>>>                               'pass' = (local('password')||'anonymous'),
>>>>   //ensure there is always a password
>>>>                               'command'='/usr/bin/curl',
>>>>                     //full path to the curl binary
>>>>                               'result' = string,
>>>>                             //container for our results
>>>>                               'stdErr' = string,
>>>>                             //container for errors
>>>>                               'flags' = array('-L','--tlsv1.2')
>>>> //ensure we are using the highest TLS for PayPal or Authorize.net. -L
>>>> required to handle reidrects
>>>>                               );
>>>>
>>>>               //All lasso options are supported in this dropin
>>>> replacement
>>>>               local_defined('Timeout') ? #flags->insert('--max-time') &
>>>> insert(integer(#timeout==0 ? 360 | #timeout));
>>>>               local_defined('ConnectTimeout') ?
>>>> #flags->insert('--connect-timeout') & insert(integer(#connecttimeout == 0
>>>> ? 360 | #connecttimeout));
>>>>               local_defined('PostParams') ? #flags->insert('--data-raw')
>>>> & insert(params_to_url(#postparams)) & insert('-X') & insert('POST');
>>>>               local_defined('GetParams') ? #flags->insert('--data-raw')
>>>> & insert(params_to_url(#postparams)) & insert('-X') & insert('GET');
>>>>               local_defined('Username') || local_defined('Password') ?
>>>> #flags->insert('-u') & insert(#user->trim& + ':' + #pass->trim&);
>>>>               local_defined('VerifyPeer') && #VerifyPeer == false ?
>>>> #flags->insert('-k');
>>>>               local_defined('SSLCert') ? #flags->insert('--cert') &
>>>> insert(#sslcert);
>>>>               local_defined('SSLCertType') && 'PEM|DER|ENG'->contains(#sslcerttype)
>>>> ? #flags->insert('--cert-type') & insert(#sslcerttype);
>>>>               local_defined('SSLKey') ? #flags->insert('--key') &
>>>> insert(#sslkey);
>>>>               local_defined('SSLKeyType') ? #flags->insert('--key-type')
>>>> & insert(#sslkeytype);
>>>>               local_defined('SSLKeyPasswd') ? #flags->insert('--pass') &
>>>> insert(#sslkeypasswd);
>>>>
>>>>               local_defined('RetrieveMIMEHeaders') ?
>>>> #flags->insert('-D') & insert('-');
>>>>               if(local_defined('SendMIMEHeaders'));
>>>>                       iterate(#SendMIMEHeaders,local('this_header'));
>>>>                               #flags->insert('-H') &
>>>> insert(#this_header->first->trim& + ': ' + #this_header->second->trim&);
>>>>                       /iterate;
>>>>               /if;
>>>>
>>>>               if(local_defined('ExtraOptions') &&
>>>> #extraoptions->isa('array'));
>>>>                       iterate(#extraoptions,local('this_flag'));
>>>>                               #flags->insert(#this_flag->trim&);
>>>>                       /iterate;
>>>>               /if;
>>>>
>>>>               //this has to be the last parameter in the array so it's
>>>> at the end of the flags
>>>>               #flags->insert(#base_url);
>>>>
>>>>               //launch the curl process with our flags
>>>>               local('myProcess' = os_process(#command,#flags));
>>>>               #result=#myProcess->read;
>>>>               #stdErr=#myProcess->ReadError;
>>>>               #myProcess->close;
>>>>
>>>>               //if there are any errors returned from the process, log
>>>> the errors so we can debug if necessary. log location subjective to Lasso
>>>> Admin settings.
>>>>               #stdErr->size ? log_detail('[Include_URL] Drop-In params '
>>>> + #flags + ' yielded stdErr message: ' + #stdErr);
>>>>
>>>>               //parse out the headers returned into the variable name
>>>> provided. This goes with the same flag above RetrieveMIMEHeaders
>>>>               if(local_defined('RetrieveMIMEHeaders'));
>>>>                       local('parts'=#result->split('\r\n'));
>>>>                       #result=#parts->last;
>>>>                       #parts->removelast;
>>>>                       var(#RetrieveMIMEHeaders) = #parts->join('\r\n');
>>>>
>>>>               /if;
>>>>
>>>>               //handle the nodata option and added a -string option from
>>>> Lasso 9 to output as a string. Defaults to bytes output
>>>>               return(local_defined('nodata') ? string |
>>>> (local_defined('string') ? @#result->exportstring('UTF-8’) | @#result));
>>>>       /define_tag;
>>>> ]
>>>>
>>>>
>>>>
>>>> Steffan A. Cline
>>>> [hidden email]
>>>> 602-793-0014
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MacOS and TLSv1.2

Laurent Gigon
I've change encoding but still have an error:

Expected: a tag name but got: "
at: /admin/TLSv1.2.lasso on line 1 at position 4.
Expected: a tag name but got: "
at: /admin/TLSv1.2.lasso on line 1 at position 4.
Expected: a tag name but got: "
at: /admin/TLSv1.2.lasso on line 1 at position 4.
Expected: a tag name but got: "
at: /admin/TLSv1.2.lasso on line 1 at position 4.



2018-07-03 21:36 GMT-04:00 Steffan Cline <[hidden email]>:

> Sounds like something was encoded wrong in the email. Look for smart quotes. If it still doesn’t work, I’ll email the file directly.
>
> Thanks,
> Steffan Cline
> [hidden email]
> 602-793-0014
>
>> On Jul 3, 2018, at 6:14 PM, Laurent G <[hidden email]> wrote:
>>
>> I've tried that include, here is the error code :
>>
>> Expected: a tag name but got: "//handle the nodata option and added a
>> -string option from Lasso 9 to output as a string. Defaults to bytes
>> output ...
>> at: Unterminated quoted literal on line 87 at position 17.
>> Container was not closed. "define_tag"
>> at: /admin/TLSv1.2.lasso on line 9 at position 9.
>>
>> Laurent
>>
>> 2018-07-03 14:13 GMT-04:00 Steffan A. Cline <[hidden email]>:
>>> Thank you. The idea was to be able to drop it in wherever needed without a need to change even one line of your original code.
>>>
>>> Steffan A. Cline
>>> [hidden email]
>>> 602-793-0014
>>>
>>>
>>>
>>>
>>>> On Jul 3, 2018, at 11:09 AM, Bil Corry <[hidden email]> wrote:
>>>>
>>>> Nice!  Thanks!
>>>>
>>>> - Bil
>>>>
>>>>> On Tue, Jul 3, 2018 at 10:44 AM, Steffan A. Cline <[hidden email]> wrote:
>>>>>
>>>>> For those of you needing support for TLSv1.2 on a Mac with Lasso 8.6,
>>>>> there a couple things you’ll need to do.
>>>>>
>>>>> Lasso compiled in it’s support of TLS to the standard at the time on each
>>>>> platform. On the Mac, that was 1.0.
>>>>>
>>>>> I recently wrote this drop in replacement for include_url which offers all
>>>>> the same options as the default built-in version. I had someone using
>>>>> PayPal tags that used include_url on a Mac using 8.6. I suppose for any
>>>>> libraries you’re using that require include_url and TLSv1.2, this might
>>>>> work fine for you. First they had to upgrade to a newer version of macOS
>>>>> that supported TLS 1.2. The following tag is not as fast as the built in
>>>>> but depending on what you’re doing the milliseconds may be negligible for
>>>>> you. Change the namespace to suit your needs. I used _page_ as not to
>>>>> override the default version for everything on the instance. I used an
>>>>> include for the code which worked flawlessly for our needs. I did add an
>>>>> extra option which allows you to specify more flags to CURL somewhat like
>>>>> the L9 version does.
>>>>>
>>>>> This code is FREE and no warranty of any kind is implied or written. Use
>>>>> at your own risk. If you enhance or modify it, please let me know so I can
>>>>> include them in any other sharing.
>>>>>
>>>>> [
>>>>>       // [include_url()] drop-in replacement.
>>>>>       // Include atop any page you want to override the built in.
>>>>>       // Will not override globally unless put in LassoStartup and
>>>>> removal of the namespace.
>>>>>       // Utilizes os_process to access the OS's built in CURL which is
>>>>> newer than the built in.
>>>>>       // See the Lasso User Guide for parameter details.
>>>>>       // Added the option -ExtraOptions. Requires an array of
>>>>> flags/switches
>>>>>       // Written by Steffan Cline 6/25/2018.
>>>>>       define_tag('include_url',
>>>>>                               //-priority='replace',
>>>>>                               -namespace='_page_');
>>>>>
>>>>>               //elementary error checking
>>>>>               fail_if(params->size==0 || params->first ==
>>>>> null,-1,'[include_url] requires a URL to process.');
>>>>>
>>>>>               //takes an array of pairs or map and turns it into a url
>>>>> encoded list of parameters
>>>>>               define_tag('params_to_url');
>>>>>                       if(params->size==1 &&
>>>>> params->first->isa('string'));
>>>>>                               return(encode_url(params->first));
>>>>>                       /if;
>>>>>                       local('out'=string,'this_item');
>>>>>                       iterate(params->first,#this_item);
>>>>>                               if(#this_item->isa('string'));
>>>>>                                       #out->append(encode_url(#this_item)
>>>>> + '&');
>>>>>                               else;
>>>>>                                       #out->append(encode_url(#this_item->first)
>>>>> + '=' + encode_url(#this_item->second) + '&');
>>>>>                               /if;
>>>>>                       /iterate;
>>>>>                       return(@#out->removetrailing('&')&);
>>>>>               /define_tag;
>>>>>
>>>>>               local(  'base_url' = params->first,
>>>>>            //the first unnamed parameter will be the URL
>>>>>                               'user' = (local('username')||'anonymous'),
>>>>>   //ensure there is always a username
>>>>>                               'pass' = (local('password')||'anonymous'),
>>>>>   //ensure there is always a password
>>>>>                               'command'='/usr/bin/curl',
>>>>>                     //full path to the curl binary
>>>>>                               'result' = string,
>>>>>                             //container for our results
>>>>>                               'stdErr' = string,
>>>>>                             //container for errors
>>>>>                               'flags' = array('-L','--tlsv1.2')
>>>>> //ensure we are using the highest TLS for PayPal or Authorize.net. -L
>>>>> required to handle reidrects
>>>>>                               );
>>>>>
>>>>>               //All lasso options are supported in this dropin
>>>>> replacement
>>>>>               local_defined('Timeout') ? #flags->insert('--max-time') &
>>>>> insert(integer(#timeout==0 ? 360 | #timeout));
>>>>>               local_defined('ConnectTimeout') ?
>>>>> #flags->insert('--connect-timeout') & insert(integer(#connecttimeout == 0
>>>>> ? 360 | #connecttimeout));
>>>>>               local_defined('PostParams') ? #flags->insert('--data-raw')
>>>>> & insert(params_to_url(#postparams)) & insert('-X') & insert('POST');
>>>>>               local_defined('GetParams') ? #flags->insert('--data-raw')
>>>>> & insert(params_to_url(#postparams)) & insert('-X') & insert('GET');
>>>>>               local_defined('Username') || local_defined('Password') ?
>>>>> #flags->insert('-u') & insert(#user->trim& + ':' + #pass->trim&);
>>>>>               local_defined('VerifyPeer') && #VerifyPeer == false ?
>>>>> #flags->insert('-k');
>>>>>               local_defined('SSLCert') ? #flags->insert('--cert') &
>>>>> insert(#sslcert);
>>>>>               local_defined('SSLCertType') && 'PEM|DER|ENG'->contains(#sslcerttype)
>>>>> ? #flags->insert('--cert-type') & insert(#sslcerttype);
>>>>>               local_defined('SSLKey') ? #flags->insert('--key') &
>>>>> insert(#sslkey);
>>>>>               local_defined('SSLKeyType') ? #flags->insert('--key-type')
>>>>> & insert(#sslkeytype);
>>>>>               local_defined('SSLKeyPasswd') ? #flags->insert('--pass') &
>>>>> insert(#sslkeypasswd);
>>>>>
>>>>>               local_defined('RetrieveMIMEHeaders') ?
>>>>> #flags->insert('-D') & insert('-');
>>>>>               if(local_defined('SendMIMEHeaders'));
>>>>>                       iterate(#SendMIMEHeaders,local('this_header'));
>>>>>                               #flags->insert('-H') &
>>>>> insert(#this_header->first->trim& + ': ' + #this_header->second->trim&);
>>>>>                       /iterate;
>>>>>               /if;
>>>>>
>>>>>               if(local_defined('ExtraOptions') &&
>>>>> #extraoptions->isa('array'));
>>>>>                       iterate(#extraoptions,local('this_flag'));
>>>>>                               #flags->insert(#this_flag->trim&);
>>>>>                       /iterate;
>>>>>               /if;
>>>>>
>>>>>               //this has to be the last parameter in the array so it's
>>>>> at the end of the flags
>>>>>               #flags->insert(#base_url);
>>>>>
>>>>>               //launch the curl process with our flags
>>>>>               local('myProcess' = os_process(#command,#flags));
>>>>>               #result=#myProcess->read;
>>>>>               #stdErr=#myProcess->ReadError;
>>>>>               #myProcess->close;
>>>>>
>>>>>               //if there are any errors returned from the process, log
>>>>> the errors so we can debug if necessary. log location subjective to Lasso
>>>>> Admin settings.
>>>>>               #stdErr->size ? log_detail('[Include_URL] Drop-In params '
>>>>> + #flags + ' yielded stdErr message: ' + #stdErr);
>>>>>
>>>>>               //parse out the headers returned into the variable name
>>>>> provided. This goes with the same flag above RetrieveMIMEHeaders
>>>>>               if(local_defined('RetrieveMIMEHeaders'));
>>>>>                       local('parts'=#result->split('\r\n'));
>>>>>                       #result=#parts->last;
>>>>>                       #parts->removelast;
>>>>>                       var(#RetrieveMIMEHeaders) = #parts->join('\r\n');
>>>>>
>>>>>               /if;
>>>>>
>>>>>               //handle the nodata option and added a -string option from
>>>>> Lasso 9 to output as a string. Defaults to bytes output
>>>>>               return(local_defined('nodata') ? string |
>>>>> (local_defined('string') ? @#result->exportstring('UTF-8’) | @#result));
>>>>>       /define_tag;
>>>>> ]
>>>>>
>>>>>
>>>>>
>>>>> Steffan A. Cline
>>>>> [hidden email]
>>>>> 602-793-0014
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> #############################################################
>>>>>
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>>  the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MacOS and TLSv1.2

Steffan A. Cline
I’ll send the file directly to you.

Thanks,
Steffan Cline
[hidden email]
602-793-0014

> On Jul 3, 2018, at 8:21 PM, Laurent G <[hidden email]> wrote:
>
> I've change encoding but still have an error:
>
> Expected: a tag name but got: "
> at: /admin/TLSv1.2.lasso on line 1 at position 4.
> Expected: a tag name but got: "
> at: /admin/TLSv1.2.lasso on line 1 at position 4.
> Expected: a tag name but got: "
> at: /admin/TLSv1.2.lasso on line 1 at position 4.
> Expected: a tag name but got: "
> at: /admin/TLSv1.2.lasso on line 1 at position 4.
>
>
>
> 2018-07-03 21:36 GMT-04:00 Steffan Cline <[hidden email]>:
>> Sounds like something was encoded wrong in the email. Look for smart quotes. If it still doesn’t work, I’ll email the file directly.
>>
>> Thanks,
>> Steffan Cline
>> [hidden email]
>> 602-793-0014
>>
>>> On Jul 3, 2018, at 6:14 PM, Laurent G <[hidden email]> wrote:
>>>
>>> I've tried that include, here is the error code :
>>>
>>> Expected: a tag name but got: "//handle the nodata option and added a
>>> -string option from Lasso 9 to output as a string. Defaults to bytes
>>> output ...
>>> at: Unterminated quoted literal on line 87 at position 17.
>>> Container was not closed. "define_tag"
>>> at: /admin/TLSv1.2.lasso on line 9 at position 9.
>>>
>>> Laurent
>>>
>>> 2018-07-03 14:13 GMT-04:00 Steffan A. Cline <[hidden email]>:
>>>> Thank you. The idea was to be able to drop it in wherever needed without a need to change even one line of your original code.
>>>>
>>>> Steffan A. Cline
>>>> [hidden email]
>>>> 602-793-0014
>>>>
>>>>
>>>>
>>>>
>>>>> On Jul 3, 2018, at 11:09 AM, Bil Corry <[hidden email]> wrote:
>>>>>
>>>>> Nice!  Thanks!
>>>>>
>>>>> - Bil
>>>>>
>>>>>> On Tue, Jul 3, 2018 at 10:44 AM, Steffan A. Cline <[hidden email]> wrote:
>>>>>>
>>>>>> For those of you needing support for TLSv1.2 on a Mac with Lasso 8.6,
>>>>>> there a couple things you’ll need to do.
>>>>>>
>>>>>> Lasso compiled in it’s support of TLS to the standard at the time on each
>>>>>> platform. On the Mac, that was 1.0.
>>>>>>
>>>>>> I recently wrote this drop in replacement for include_url which offers all
>>>>>> the same options as the default built-in version. I had someone using
>>>>>> PayPal tags that used include_url on a Mac using 8.6. I suppose for any
>>>>>> libraries you’re using that require include_url and TLSv1.2, this might
>>>>>> work fine for you. First they had to upgrade to a newer version of macOS
>>>>>> that supported TLS 1.2. The following tag is not as fast as the built in
>>>>>> but depending on what you’re doing the milliseconds may be negligible for
>>>>>> you. Change the namespace to suit your needs. I used _page_ as not to
>>>>>> override the default version for everything on the instance. I used an
>>>>>> include for the code which worked flawlessly for our needs. I did add an
>>>>>> extra option which allows you to specify more flags to CURL somewhat like
>>>>>> the L9 version does.
>>>>>>
>>>>>> This code is FREE and no warranty of any kind is implied or written. Use
>>>>>> at your own risk. If you enhance or modify it, please let me know so I can
>>>>>> include them in any other sharing.
>>>>>>
>>>>>> [
>>>>>>      // [include_url()] drop-in replacement.
>>>>>>      // Include atop any page you want to override the built in.
>>>>>>      // Will not override globally unless put in LassoStartup and
>>>>>> removal of the namespace.
>>>>>>      // Utilizes os_process to access the OS's built in CURL which is
>>>>>> newer than the built in.
>>>>>>      // See the Lasso User Guide for parameter details.
>>>>>>      // Added the option -ExtraOptions. Requires an array of
>>>>>> flags/switches
>>>>>>      // Written by Steffan Cline 6/25/2018.
>>>>>>      define_tag('include_url',
>>>>>>                              //-priority='replace',
>>>>>>                              -namespace='_page_');
>>>>>>
>>>>>>              //elementary error checking
>>>>>>              fail_if(params->size==0 || params->first ==
>>>>>> null,-1,'[include_url] requires a URL to process.');
>>>>>>
>>>>>>              //takes an array of pairs or map and turns it into a url
>>>>>> encoded list of parameters
>>>>>>              define_tag('params_to_url');
>>>>>>                      if(params->size==1 &&
>>>>>> params->first->isa('string'));
>>>>>>                              return(encode_url(params->first));
>>>>>>                      /if;
>>>>>>                      local('out'=string,'this_item');
>>>>>>                      iterate(params->first,#this_item);
>>>>>>                              if(#this_item->isa('string'));
>>>>>>                                      #out->append(encode_url(#this_item)
>>>>>> + '&');
>>>>>>                              else;
>>>>>>                                      #out->append(encode_url(#this_item->first)
>>>>>> + '=' + encode_url(#this_item->second) + '&');
>>>>>>                              /if;
>>>>>>                      /iterate;
>>>>>>                      return(@#out->removetrailing('&')&);
>>>>>>              /define_tag;
>>>>>>
>>>>>>              local(  'base_url' = params->first,
>>>>>>           //the first unnamed parameter will be the URL
>>>>>>                              'user' = (local('username')||'anonymous'),
>>>>>>  //ensure there is always a username
>>>>>>                              'pass' = (local('password')||'anonymous'),
>>>>>>  //ensure there is always a password
>>>>>>                              'command'='/usr/bin/curl',
>>>>>>                    //full path to the curl binary
>>>>>>                              'result' = string,
>>>>>>                            //container for our results
>>>>>>                              'stdErr' = string,
>>>>>>                            //container for errors
>>>>>>                              'flags' = array('-L','--tlsv1.2')
>>>>>> //ensure we are using the highest TLS for PayPal or Authorize.net. -L
>>>>>> required to handle reidrects
>>>>>>                              );
>>>>>>
>>>>>>              //All lasso options are supported in this dropin
>>>>>> replacement
>>>>>>              local_defined('Timeout') ? #flags->insert('--max-time') &
>>>>>> insert(integer(#timeout==0 ? 360 | #timeout));
>>>>>>              local_defined('ConnectTimeout') ?
>>>>>> #flags->insert('--connect-timeout') & insert(integer(#connecttimeout == 0
>>>>>> ? 360 | #connecttimeout));
>>>>>>              local_defined('PostParams') ? #flags->insert('--data-raw')
>>>>>> & insert(params_to_url(#postparams)) & insert('-X') & insert('POST');
>>>>>>              local_defined('GetParams') ? #flags->insert('--data-raw')
>>>>>> & insert(params_to_url(#postparams)) & insert('-X') & insert('GET');
>>>>>>              local_defined('Username') || local_defined('Password') ?
>>>>>> #flags->insert('-u') & insert(#user->trim& + ':' + #pass->trim&);
>>>>>>              local_defined('VerifyPeer') && #VerifyPeer == false ?
>>>>>> #flags->insert('-k');
>>>>>>              local_defined('SSLCert') ? #flags->insert('--cert') &
>>>>>> insert(#sslcert);
>>>>>>              local_defined('SSLCertType') && 'PEM|DER|ENG'->contains(#sslcerttype)
>>>>>> ? #flags->insert('--cert-type') & insert(#sslcerttype);
>>>>>>              local_defined('SSLKey') ? #flags->insert('--key') &
>>>>>> insert(#sslkey);
>>>>>>              local_defined('SSLKeyType') ? #flags->insert('--key-type')
>>>>>> & insert(#sslkeytype);
>>>>>>              local_defined('SSLKeyPasswd') ? #flags->insert('--pass') &
>>>>>> insert(#sslkeypasswd);
>>>>>>
>>>>>>              local_defined('RetrieveMIMEHeaders') ?
>>>>>> #flags->insert('-D') & insert('-');
>>>>>>              if(local_defined('SendMIMEHeaders'));
>>>>>>                      iterate(#SendMIMEHeaders,local('this_header'));
>>>>>>                              #flags->insert('-H') &
>>>>>> insert(#this_header->first->trim& + ': ' + #this_header->second->trim&);
>>>>>>                      /iterate;
>>>>>>              /if;
>>>>>>
>>>>>>              if(local_defined('ExtraOptions') &&
>>>>>> #extraoptions->isa('array'));
>>>>>>                      iterate(#extraoptions,local('this_flag'));
>>>>>>                              #flags->insert(#this_flag->trim&);
>>>>>>                      /iterate;
>>>>>>              /if;
>>>>>>
>>>>>>              //this has to be the last parameter in the array so it's
>>>>>> at the end of the flags
>>>>>>              #flags->insert(#base_url);
>>>>>>
>>>>>>              //launch the curl process with our flags
>>>>>>              local('myProcess' = os_process(#command,#flags));
>>>>>>              #result=#myProcess->read;
>>>>>>              #stdErr=#myProcess->ReadError;
>>>>>>              #myProcess->close;
>>>>>>
>>>>>>              //if there are any errors returned from the process, log
>>>>>> the errors so we can debug if necessary. log location subjective to Lasso
>>>>>> Admin settings.
>>>>>>              #stdErr->size ? log_detail('[Include_URL] Drop-In params '
>>>>>> + #flags + ' yielded stdErr message: ' + #stdErr);
>>>>>>
>>>>>>              //parse out the headers returned into the variable name
>>>>>> provided. This goes with the same flag above RetrieveMIMEHeaders
>>>>>>              if(local_defined('RetrieveMIMEHeaders'));
>>>>>>                      local('parts'=#result->split('\r\n'));
>>>>>>                      #result=#parts->last;
>>>>>>                      #parts->removelast;
>>>>>>                      var(#RetrieveMIMEHeaders) = #parts->join('\r\n');
>>>>>>
>>>>>>              /if;
>>>>>>
>>>>>>              //handle the nodata option and added a -string option from
>>>>>> Lasso 9 to output as a string. Defaults to bytes output
>>>>>>              return(local_defined('nodata') ? string |
>>>>>> (local_defined('string') ? @#result->exportstring('UTF-8’) | @#result));
>>>>>>      /define_tag;
>>>>>> ]
>>>>>>
>>>>>>
>>>>>>
>>>>>> Steffan A. Cline
>>>>>> [hidden email]
>>>>>> 602-793-0014
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>>
>>>>>> This message is sent to you because you are subscribed to
>>>>>> the mailing list Lasso [hidden email]
>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>> #############################################################
>>>>>
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MacOS and TLSv1.2

Laurent Gigon
Thank you Steffan!

2018-07-03 23:22 GMT-04:00 Steffan Cline <[hidden email]>:

> I’ll send the file directly to you.
>
> Thanks,
> Steffan Cline
> [hidden email]
> 602-793-0014
>
>> On Jul 3, 2018, at 8:21 PM, Laurent G <[hidden email]> wrote:
>>
>> I've change encoding but still have an error:
>>
>> Expected: a tag name but got: "
>> at: /admin/TLSv1.2.lasso on line 1 at position 4.
>> Expected: a tag name but got: "
>> at: /admin/TLSv1.2.lasso on line 1 at position 4.
>> Expected: a tag name but got: "
>> at: /admin/TLSv1.2.lasso on line 1 at position 4.
>> Expected: a tag name but got: "
>> at: /admin/TLSv1.2.lasso on line 1 at position 4.
>>
>>
>>
>> 2018-07-03 21:36 GMT-04:00 Steffan Cline <[hidden email]>:
>>> Sounds like something was encoded wrong in the email. Look for smart quotes. If it still doesn’t work, I’ll email the file directly.
>>>
>>> Thanks,
>>> Steffan Cline
>>> [hidden email]
>>> 602-793-0014
>>>
>>>> On Jul 3, 2018, at 6:14 PM, Laurent G <[hidden email]> wrote:
>>>>
>>>> I've tried that include, here is the error code :
>>>>
>>>> Expected: a tag name but got: "//handle the nodata option and added a
>>>> -string option from Lasso 9 to output as a string. Defaults to bytes
>>>> output ...
>>>> at: Unterminated quoted literal on line 87 at position 17.
>>>> Container was not closed. "define_tag"
>>>> at: /admin/TLSv1.2.lasso on line 9 at position 9.
>>>>
>>>> Laurent
>>>>
>>>> 2018-07-03 14:13 GMT-04:00 Steffan A. Cline <[hidden email]>:
>>>>> Thank you. The idea was to be able to drop it in wherever needed without a need to change even one line of your original code.
>>>>>
>>>>> Steffan A. Cline
>>>>> [hidden email]
>>>>> 602-793-0014
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> On Jul 3, 2018, at 11:09 AM, Bil Corry <[hidden email]> wrote:
>>>>>>
>>>>>> Nice!  Thanks!
>>>>>>
>>>>>> - Bil
>>>>>>
>>>>>>> On Tue, Jul 3, 2018 at 10:44 AM, Steffan A. Cline <[hidden email]> wrote:
>>>>>>>
>>>>>>> For those of you needing support for TLSv1.2 on a Mac with Lasso 8.6,
>>>>>>> there a couple things you’ll need to do.
>>>>>>>
>>>>>>> Lasso compiled in it’s support of TLS to the standard at the time on each
>>>>>>> platform. On the Mac, that was 1.0.
>>>>>>>
>>>>>>> I recently wrote this drop in replacement for include_url which offers all
>>>>>>> the same options as the default built-in version. I had someone using
>>>>>>> PayPal tags that used include_url on a Mac using 8.6. I suppose for any
>>>>>>> libraries you’re using that require include_url and TLSv1.2, this might
>>>>>>> work fine for you. First they had to upgrade to a newer version of macOS
>>>>>>> that supported TLS 1.2. The following tag is not as fast as the built in
>>>>>>> but depending on what you’re doing the milliseconds may be negligible for
>>>>>>> you. Change the namespace to suit your needs. I used _page_ as not to
>>>>>>> override the default version for everything on the instance. I used an
>>>>>>> include for the code which worked flawlessly for our needs. I did add an
>>>>>>> extra option which allows you to specify more flags to CURL somewhat like
>>>>>>> the L9 version does.
>>>>>>>
>>>>>>> This code is FREE and no warranty of any kind is implied or written. Use
>>>>>>> at your own risk. If you enhance or modify it, please let me know so I can
>>>>>>> include them in any other sharing.
>>>>>>>
>>>>>>> [
>>>>>>>      // [include_url()] drop-in replacement.
>>>>>>>      // Include atop any page you want to override the built in.
>>>>>>>      // Will not override globally unless put in LassoStartup and
>>>>>>> removal of the namespace.
>>>>>>>      // Utilizes os_process to access the OS's built in CURL which is
>>>>>>> newer than the built in.
>>>>>>>      // See the Lasso User Guide for parameter details.
>>>>>>>      // Added the option -ExtraOptions. Requires an array of
>>>>>>> flags/switches
>>>>>>>      // Written by Steffan Cline 6/25/2018.
>>>>>>>      define_tag('include_url',
>>>>>>>                              //-priority='replace',
>>>>>>>                              -namespace='_page_');
>>>>>>>
>>>>>>>              //elementary error checking
>>>>>>>              fail_if(params->size==0 || params->first ==
>>>>>>> null,-1,'[include_url] requires a URL to process.');
>>>>>>>
>>>>>>>              //takes an array of pairs or map and turns it into a url
>>>>>>> encoded list of parameters
>>>>>>>              define_tag('params_to_url');
>>>>>>>                      if(params->size==1 &&
>>>>>>> params->first->isa('string'));
>>>>>>>                              return(encode_url(params->first));
>>>>>>>                      /if;
>>>>>>>                      local('out'=string,'this_item');
>>>>>>>                      iterate(params->first,#this_item);
>>>>>>>                              if(#this_item->isa('string'));
>>>>>>>                                      #out->append(encode_url(#this_item)
>>>>>>> + '&');
>>>>>>>                              else;
>>>>>>>                                      #out->append(encode_url(#this_item->first)
>>>>>>> + '=' + encode_url(#this_item->second) + '&');
>>>>>>>                              /if;
>>>>>>>                      /iterate;
>>>>>>>                      return(@#out->removetrailing('&')&);
>>>>>>>              /define_tag;
>>>>>>>
>>>>>>>              local(  'base_url' = params->first,
>>>>>>>           //the first unnamed parameter will be the URL
>>>>>>>                              'user' = (local('username')||'anonymous'),
>>>>>>>  //ensure there is always a username
>>>>>>>                              'pass' = (local('password')||'anonymous'),
>>>>>>>  //ensure there is always a password
>>>>>>>                              'command'='/usr/bin/curl',
>>>>>>>                    //full path to the curl binary
>>>>>>>                              'result' = string,
>>>>>>>                            //container for our results
>>>>>>>                              'stdErr' = string,
>>>>>>>                            //container for errors
>>>>>>>                              'flags' = array('-L','--tlsv1.2')
>>>>>>> //ensure we are using the highest TLS for PayPal or Authorize.net. -L
>>>>>>> required to handle reidrects
>>>>>>>                              );
>>>>>>>
>>>>>>>              //All lasso options are supported in this dropin
>>>>>>> replacement
>>>>>>>              local_defined('Timeout') ? #flags->insert('--max-time') &
>>>>>>> insert(integer(#timeout==0 ? 360 | #timeout));
>>>>>>>              local_defined('ConnectTimeout') ?
>>>>>>> #flags->insert('--connect-timeout') & insert(integer(#connecttimeout == 0
>>>>>>> ? 360 | #connecttimeout));
>>>>>>>              local_defined('PostParams') ? #flags->insert('--data-raw')
>>>>>>> & insert(params_to_url(#postparams)) & insert('-X') & insert('POST');
>>>>>>>              local_defined('GetParams') ? #flags->insert('--data-raw')
>>>>>>> & insert(params_to_url(#postparams)) & insert('-X') & insert('GET');
>>>>>>>              local_defined('Username') || local_defined('Password') ?
>>>>>>> #flags->insert('-u') & insert(#user->trim& + ':' + #pass->trim&);
>>>>>>>              local_defined('VerifyPeer') && #VerifyPeer == false ?
>>>>>>> #flags->insert('-k');
>>>>>>>              local_defined('SSLCert') ? #flags->insert('--cert') &
>>>>>>> insert(#sslcert);
>>>>>>>              local_defined('SSLCertType') && 'PEM|DER|ENG'->contains(#sslcerttype)
>>>>>>> ? #flags->insert('--cert-type') & insert(#sslcerttype);
>>>>>>>              local_defined('SSLKey') ? #flags->insert('--key') &
>>>>>>> insert(#sslkey);
>>>>>>>              local_defined('SSLKeyType') ? #flags->insert('--key-type')
>>>>>>> & insert(#sslkeytype);
>>>>>>>              local_defined('SSLKeyPasswd') ? #flags->insert('--pass') &
>>>>>>> insert(#sslkeypasswd);
>>>>>>>
>>>>>>>              local_defined('RetrieveMIMEHeaders') ?
>>>>>>> #flags->insert('-D') & insert('-');
>>>>>>>              if(local_defined('SendMIMEHeaders'));
>>>>>>>                      iterate(#SendMIMEHeaders,local('this_header'));
>>>>>>>                              #flags->insert('-H') &
>>>>>>> insert(#this_header->first->trim& + ': ' + #this_header->second->trim&);
>>>>>>>                      /iterate;
>>>>>>>              /if;
>>>>>>>
>>>>>>>              if(local_defined('ExtraOptions') &&
>>>>>>> #extraoptions->isa('array'));
>>>>>>>                      iterate(#extraoptions,local('this_flag'));
>>>>>>>                              #flags->insert(#this_flag->trim&);
>>>>>>>                      /iterate;
>>>>>>>              /if;
>>>>>>>
>>>>>>>              //this has to be the last parameter in the array so it's
>>>>>>> at the end of the flags
>>>>>>>              #flags->insert(#base_url);
>>>>>>>
>>>>>>>              //launch the curl process with our flags
>>>>>>>              local('myProcess' = os_process(#command,#flags));
>>>>>>>              #result=#myProcess->read;
>>>>>>>              #stdErr=#myProcess->ReadError;
>>>>>>>              #myProcess->close;
>>>>>>>
>>>>>>>              //if there are any errors returned from the process, log
>>>>>>> the errors so we can debug if necessary. log location subjective to Lasso
>>>>>>> Admin settings.
>>>>>>>              #stdErr->size ? log_detail('[Include_URL] Drop-In params '
>>>>>>> + #flags + ' yielded stdErr message: ' + #stdErr);
>>>>>>>
>>>>>>>              //parse out the headers returned into the variable name
>>>>>>> provided. This goes with the same flag above RetrieveMIMEHeaders
>>>>>>>              if(local_defined('RetrieveMIMEHeaders'));
>>>>>>>                      local('parts'=#result->split('\r\n'));
>>>>>>>                      #result=#parts->last;
>>>>>>>                      #parts->removelast;
>>>>>>>                      var(#RetrieveMIMEHeaders) = #parts->join('\r\n');
>>>>>>>
>>>>>>>              /if;
>>>>>>>
>>>>>>>              //handle the nodata option and added a -string option from
>>>>>>> Lasso 9 to output as a string. Defaults to bytes output
>>>>>>>              return(local_defined('nodata') ? string |
>>>>>>> (local_defined('string') ? @#result->exportstring('UTF-8’) | @#result));
>>>>>>>      /define_tag;
>>>>>>> ]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Steffan A. Cline
>>>>>>> [hidden email]
>>>>>>> 602-793-0014
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> #############################################################
>>>>>>>
>>>>>>> This message is sent to you because you are subscribed to
>>>>>>> the mailing list Lasso [hidden email]
>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>
>>>>>> #############################################################
>>>>>>
>>>>>> This message is sent to you because you are subscribed to
>>>>>> the mailing list Lasso [hidden email]
>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>>
>>>>> #############################################################
>>>>>
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>>  the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MacOS and TLSv1.2

Laurent Gigon
In reply to this post by Steffan A. Cline
I've found the encoding error in you file, the last comma is not
formatted correctly.

So I've installed OS_Process but there is the user/pass window in the
browser when I execute that script. Any idea?

Laurent


2018-07-03 13:44 GMT-04:00 Steffan A. Cline <[hidden email]>:

> For those of you needing support for TLSv1.2 on a Mac with Lasso 8.6, there a couple things you’ll need to do.
>
> Lasso compiled in it’s support of TLS to the standard at the time on each platform. On the Mac, that was 1.0.
>
> I recently wrote this drop in replacement for include_url which offers all the same options as the default built-in version. I had someone using PayPal tags that used include_url on a Mac using 8.6. I suppose for any libraries you’re using that require include_url and TLSv1.2, this might work fine for you. First they had to upgrade to a newer version of macOS that supported TLS 1.2. The following tag is not as fast as the built in but depending on what you’re doing the milliseconds may be negligible for you. Change the namespace to suit your needs. I used _page_ as not to override the default version for everything on the instance. I used an include for the code which worked flawlessly for our needs. I did add an extra option which allows you to specify more flags to CURL somewhat like the L9 version does.
>
> This code is FREE and no warranty of any kind is implied or written. Use at your own risk. If you enhance or modify it, please let me know so I can include them in any other sharing.
>
> [
>         // [include_url()] drop-in replacement.
>         // Include atop any page you want to override the built in.
>         // Will not override globally unless put in LassoStartup and removal of the namespace.
>         // Utilizes os_process to access the OS's built in CURL which is newer than the built in.
>         // See the Lasso User Guide for parameter details.
>         // Added the option -ExtraOptions. Requires an array of flags/switches
>         // Written by Steffan Cline 6/25/2018.
>         define_tag('include_url',
>                                 //-priority='replace',
>                                 -namespace='_page_');
>
>                 //elementary error checking
>                 fail_if(params->size==0 || params->first == null,-1,'[include_url] requires a URL to process.');
>
>                 //takes an array of pairs or map and turns it into a url encoded list of parameters
>                 define_tag('params_to_url');
>                         if(params->size==1 && params->first->isa('string'));
>                                 return(encode_url(params->first));
>                         /if;
>                         local('out'=string,'this_item');
>                         iterate(params->first,#this_item);
>                                 if(#this_item->isa('string'));
>                                         #out->append(encode_url(#this_item) + '&');
>                                 else;
>                                         #out->append(encode_url(#this_item->first) + '=' + encode_url(#this_item->second) + '&');
>                                 /if;
>                         /iterate;
>                         return(@#out->removetrailing('&')&);
>                 /define_tag;
>
>                 local(  'base_url' = params->first,                                     //the first unnamed parameter will be the URL
>                                 'user' = (local('username')||'anonymous'),      //ensure there is always a username
>                                 'pass' = (local('password')||'anonymous'),      //ensure there is always a password
>                                 'command'='/usr/bin/curl',                                      //full path to the curl binary
>                                 'result' = string,                                                      //container for our results
>                                 'stdErr' = string,                                                      //container for errors
>                                 'flags' = array('-L','--tlsv1.2')       //ensure we are using the highest TLS for PayPal or Authorize.net. -L required to handle reidrects
>                                 );
>
>                 //All lasso options are supported in this dropin replacement
>                 local_defined('Timeout') ? #flags->insert('--max-time') & insert(integer(#timeout==0 ? 360 | #timeout));
>                 local_defined('ConnectTimeout') ? #flags->insert('--connect-timeout') & insert(integer(#connecttimeout == 0 ? 360 | #connecttimeout));
>                 local_defined('PostParams') ? #flags->insert('--data-raw') & insert(params_to_url(#postparams)) & insert('-X') & insert('POST');
>                 local_defined('GetParams') ? #flags->insert('--data-raw') & insert(params_to_url(#postparams)) & insert('-X') & insert('GET');
>                 local_defined('Username') || local_defined('Password') ? #flags->insert('-u') & insert(#user->trim& + ':' + #pass->trim&);
>                 local_defined('VerifyPeer') && #VerifyPeer == false ? #flags->insert('-k');
>                 local_defined('SSLCert') ? #flags->insert('--cert') & insert(#sslcert);
>                 local_defined('SSLCertType') && 'PEM|DER|ENG'->contains(#sslcerttype) ? #flags->insert('--cert-type') & insert(#sslcerttype);
>                 local_defined('SSLKey') ? #flags->insert('--key') & insert(#sslkey);
>                 local_defined('SSLKeyType') ? #flags->insert('--key-type') & insert(#sslkeytype);
>                 local_defined('SSLKeyPasswd') ? #flags->insert('--pass') & insert(#sslkeypasswd);
>
>                 local_defined('RetrieveMIMEHeaders') ? #flags->insert('-D') & insert('-');
>                 if(local_defined('SendMIMEHeaders'));
>                         iterate(#SendMIMEHeaders,local('this_header'));
>                                 #flags->insert('-H') & insert(#this_header->first->trim& + ': ' + #this_header->second->trim&);
>                         /iterate;
>                 /if;
>
>                 if(local_defined('ExtraOptions') && #extraoptions->isa('array'));
>                         iterate(#extraoptions,local('this_flag'));
>                                 #flags->insert(#this_flag->trim&);
>                         /iterate;
>                 /if;
>
>                 //this has to be the last parameter in the array so it's at the end of the flags
>                 #flags->insert(#base_url);
>
>                 //launch the curl process with our flags
>                 local('myProcess' = os_process(#command,#flags));
>                 #result=#myProcess->read;
>                 #stdErr=#myProcess->ReadError;
>                 #myProcess->close;
>
>                 //if there are any errors returned from the process, log the errors so we can debug if necessary. log location subjective to Lasso Admin settings.
>                 #stdErr->size ? log_detail('[Include_URL] Drop-In params ' + #flags + ' yielded stdErr message: ' + #stdErr);
>
>                 //parse out the headers returned into the variable name provided. This goes with the same flag above RetrieveMIMEHeaders
>                 if(local_defined('RetrieveMIMEHeaders'));
>                         local('parts'=#result->split('\r\n'));
>                         #result=#parts->last;
>                         #parts->removelast;
>                         var(#RetrieveMIMEHeaders) = #parts->join('\r\n');
>                 /if;
>
>                 //handle the nodata option and added a -string option from Lasso 9 to output as a string. Defaults to bytes output
>                 return(local_defined('nodata') ? string | (local_defined('string') ? @#result->exportstring('UTF-8’) | @#result));
>         /define_tag;
> ]
>
>
>
> Steffan A. Cline
> [hidden email]
> 602-793-0014
>
>
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: MacOS and TLSv1.2

Steffan A. Cline
Once you install the os_process, you have to explicitly allow it to run in Lasso Security, otherwise you’ll get the lasso security auth prompt when executing any code that uses it. I think there’s an entry in the user guide that tells you how to set that up.


Steffan A. Cline
[hidden email]
602-793-0014




> On Jul 4, 2018, at 8:46 AM, Laurent G <[hidden email]> wrote:
>
> I've found the encoding error in you file, the last comma is not
> formatted correctly.
>
> So I've installed OS_Process but there is the user/pass window in the
> browser when I execute that script. Any idea?
>
> Laurent
>
>
> 2018-07-03 13:44 GMT-04:00 Steffan A. Cline <[hidden email]>:
>> For those of you needing support for TLSv1.2 on a Mac with Lasso 8.6, there a couple things you’ll need to do.
>>
>> Lasso compiled in it’s support of TLS to the standard at the time on each platform. On the Mac, that was 1.0.
>>
>> I recently wrote this drop in replacement for include_url which offers all the same options as the default built-in version. I had someone using PayPal tags that used include_url on a Mac using 8.6. I suppose for any libraries you’re using that require include_url and TLSv1.2, this might work fine for you. First they had to upgrade to a newer version of macOS that supported TLS 1.2. The following tag is not as fast as the built in but depending on what you’re doing the milliseconds may be negligible for you. Change the namespace to suit your needs. I used _page_ as not to override the default version for everything on the instance. I used an include for the code which worked flawlessly for our needs. I did add an extra option which allows you to specify more flags to CURL somewhat like the L9 version does.
>>
>> This code is FREE and no warranty of any kind is implied or written. Use at your own risk. If you enhance or modify it, please let me know so I can include them in any other sharing.
>>
>> [
>>        // [include_url()] drop-in replacement.
>>        // Include atop any page you want to override the built in.
>>        // Will not override globally unless put in LassoStartup and removal of the namespace.
>>        // Utilizes os_process to access the OS's built in CURL which is newer than the built in.
>>        // See the Lasso User Guide for parameter details.
>>        // Added the option -ExtraOptions. Requires an array of flags/switches
>>        // Written by Steffan Cline 6/25/2018.
>>        define_tag('include_url',
>>                                //-priority='replace',
>>                                -namespace='_page_');
>>
>>                //elementary error checking
>>                fail_if(params->size==0 || params->first == null,-1,'[include_url] requires a URL to process.');
>>
>>                //takes an array of pairs or map and turns it into a url encoded list of parameters
>>                define_tag('params_to_url');
>>                        if(params->size==1 && params->first->isa('string'));
>>                                return(encode_url(params->first));
>>                        /if;
>>                        local('out'=string,'this_item');
>>                        iterate(params->first,#this_item);
>>                                if(#this_item->isa('string'));
>>                                        #out->append(encode_url(#this_item) + '&');
>>                                else;
>>                                        #out->append(encode_url(#this_item->first) + '=' + encode_url(#this_item->second) + '&');
>>                                /if;
>>                        /iterate;
>>                        return(@#out->removetrailing('&')&);
>>                /define_tag;
>>
>>                local(  'base_url' = params->first,                                     //the first unnamed parameter will be the URL
>>                                'user' = (local('username')||'anonymous'),      //ensure there is always a username
>>                                'pass' = (local('password')||'anonymous'),      //ensure there is always a password
>>                                'command'='/usr/bin/curl',                                      //full path to the curl binary
>>                                'result' = string,                                                      //container for our results
>>                                'stdErr' = string,                                                      //container for errors
>>                                'flags' = array('-L','--tlsv1.2')       //ensure we are using the highest TLS for PayPal or Authorize.net. -L required to handle reidrects
>>                                );
>>
>>                //All lasso options are supported in this dropin replacement
>>                local_defined('Timeout') ? #flags->insert('--max-time') & insert(integer(#timeout==0 ? 360 | #timeout));
>>                local_defined('ConnectTimeout') ? #flags->insert('--connect-timeout') & insert(integer(#connecttimeout == 0 ? 360 | #connecttimeout));
>>                local_defined('PostParams') ? #flags->insert('--data-raw') & insert(params_to_url(#postparams)) & insert('-X') & insert('POST');
>>                local_defined('GetParams') ? #flags->insert('--data-raw') & insert(params_to_url(#postparams)) & insert('-X') & insert('GET');
>>                local_defined('Username') || local_defined('Password') ? #flags->insert('-u') & insert(#user->trim& + ':' + #pass->trim&);
>>                local_defined('VerifyPeer') && #VerifyPeer == false ? #flags->insert('-k');
>>                local_defined('SSLCert') ? #flags->insert('--cert') & insert(#sslcert);
>>                local_defined('SSLCertType') && 'PEM|DER|ENG'->contains(#sslcerttype) ? #flags->insert('--cert-type') & insert(#sslcerttype);
>>                local_defined('SSLKey') ? #flags->insert('--key') & insert(#sslkey);
>>                local_defined('SSLKeyType') ? #flags->insert('--key-type') & insert(#sslkeytype);
>>                local_defined('SSLKeyPasswd') ? #flags->insert('--pass') & insert(#sslkeypasswd);
>>
>>                local_defined('RetrieveMIMEHeaders') ? #flags->insert('-D') & insert('-');
>>                if(local_defined('SendMIMEHeaders'));
>>                        iterate(#SendMIMEHeaders,local('this_header'));
>>                                #flags->insert('-H') & insert(#this_header->first->trim& + ': ' + #this_header->second->trim&);
>>                        /iterate;
>>                /if;
>>
>>                if(local_defined('ExtraOptions') && #extraoptions->isa('array'));
>>                        iterate(#extraoptions,local('this_flag'));
>>                                #flags->insert(#this_flag->trim&);
>>                        /iterate;
>>                /if;
>>
>>                //this has to be the last parameter in the array so it's at the end of the flags
>>                #flags->insert(#base_url);
>>
>>                //launch the curl process with our flags
>>                local('myProcess' = os_process(#command,#flags));
>>                #result=#myProcess->read;
>>                #stdErr=#myProcess->ReadError;
>>                #myProcess->close;
>>
>>                //if there are any errors returned from the process, log the errors so we can debug if necessary. log location subjective to Lasso Admin settings.
>>                #stdErr->size ? log_detail('[Include_URL] Drop-In params ' + #flags + ' yielded stdErr message: ' + #stdErr);
>>
>>                //parse out the headers returned into the variable name provided. This goes with the same flag above RetrieveMIMEHeaders
>>                if(local_defined('RetrieveMIMEHeaders'));
>>                        local('parts'=#result->split('\r\n'));
>>                        #result=#parts->last;
>>                        #parts->removelast;
>>                        var(#RetrieveMIMEHeaders) = #parts->join('\r\n');
>>                /if;
>>
>>                //handle the nodata option and added a -string option from Lasso 9 to output as a string. Defaults to bytes output
>>                return(local_defined('nodata') ? string | (local_defined('string') ? @#result->exportstring('UTF-8’) | @#result));
>>        /define_tag;
>> ]
>>
>>
>>
>> Steffan A. Cline
>> [hidden email]
>> 602-793-0014
>>
>>
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>