Re: [Mojolicious] SSL options via UserAgent?

2019-04-29 Thread Stefan Adams
If you're ok with Mojo::UserAgent not requiring a valid TLS certificate,
just set insecure to a true value.

https://mojolicious.org/perldoc/Mojo/UserAgent#insecure

# Disable TLS certificate verification for testing
say $ua->insecure(1)->get('https://127.0.0.1:3000')->result->code;


On Mon, Apr 29, 2019, 6:46 PM  wrote:

> I'm running a web scraper against a large number of devices that use HTTPS
> for configuration and ran into an issue where some of the older devices
> select a cipher suite that causes the SSL client to dump out a 'dh key too
> short' error.
> I can get resolve it by changing the list of available ciphers by running
> perl in debug mode and adding $options{tls_ciphers} = 'DEFAULT:!DH' inside
> of UserAgent->_connect.
> I can't seem to find any way to get that value added to the IOLoop::TLS
> (other than manually breaking in and adding it)
> I'm admittedly a Mojo novice.  Am I missing something obvious here or am I
> resigned to have to forego the ease of UserAgent and roll my own IOLoop
> client?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Using Mojolicious::Lite Syntax in Modules to Add Routes

2019-04-29 Thread Viktor Nacht
Thank you for all of the input, this suggestion is basically the solution I 
arrived at on my own:

MyApp::Admin::add_routes(app);

Not everyone's cup of tea, but I love the flexibility.

Thank you!

V

On Monday, April 29, 2019 at 3:17:18 PM UTC-7, Dan Book wrote:
>
> No, the Lite DSL can only be imported into one "app" script for the "app". 
> However, you could call a function and pass it `app` or `app->routes` to 
> add routes to like a full app would.
>
> -Dan
>
> On Mon, Apr 29, 2019 at 2:15 PM Viktor Nacht  > wrote:
>
>> I have a fairly simple Mojo app where I just want to spin off the admin 
>> routes into a module but still use the Mojolicious::Lite syntax. I 
>> understand I could "grow" the app, but that would add a lot of extra files 
>> where I really just need to add one file. 
>>
>> Is something like this possible? I tried the "obvious" approach but no 
>> luck.
>>
>> use Mojolicious::Lite;
>> use MyApp::Admin;
>>
>> get '/public'
>>
>> app->start;
>>
>> package MyApp::Admin;
>>
>> use Mojolicious::Lite;
>>
>> get '/admin';
>>
>> The route /admin isn't added even though the module is found and 
>> processed (using FindBin). Any thoughts?
>>
>> Thank you!
>>
>> V
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mojol...@googlegroups.com .
>> To post to this group, send email to mojol...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/mojolicious.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


[Mojolicious] SSL options via UserAgent?

2019-04-29 Thread smaskell . goog
I'm running a web scraper against a large number of devices that use HTTPS 
for configuration and ran into an issue where some of the older devices 
select a cipher suite that causes the SSL client to dump out a 'dh key too 
short' error.
I can get resolve it by changing the list of available ciphers by running 
perl in debug mode and adding $options{tls_ciphers} = 'DEFAULT:!DH' inside 
of UserAgent->_connect.
I can't seem to find any way to get that value added to the IOLoop::TLS 
(other than manually breaking in and adding it)
I'm admittedly a Mojo novice.  Am I missing something obvious here or am I 
resigned to have to forego the ease of UserAgent and roll my own IOLoop 
client?

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Using Mojolicious::Lite Syntax in Modules to Add Routes

2019-04-29 Thread Dan Book
Another option is to make separate self contained lite apps and mount/embed
them together. See
https://metacpan.org/pod/Mojolicious::Guides::Routing#Mount-applications and
the below embedding section.

-Dan

On Mon, Apr 29, 2019 at 6:16 PM Dan Book  wrote:

> No, the Lite DSL can only be imported into one "app" script for the "app".
> However, you could call a function and pass it `app` or `app->routes` to
> add routes to like a full app would.
>
> -Dan
>
> On Mon, Apr 29, 2019 at 2:15 PM Viktor Nacht 
> wrote:
>
>> I have a fairly simple Mojo app where I just want to spin off the admin
>> routes into a module but still use the Mojolicious::Lite syntax. I
>> understand I could "grow" the app, but that would add a lot of extra files
>> where I really just need to add one file.
>>
>> Is something like this possible? I tried the "obvious" approach but no
>> luck.
>>
>> use Mojolicious::Lite;
>> use MyApp::Admin;
>>
>> get '/public'
>>
>> app->start;
>>
>> package MyApp::Admin;
>>
>> use Mojolicious::Lite;
>>
>> get '/admin';
>>
>> The route /admin isn't added even though the module is found and
>> processed (using FindBin). Any thoughts?
>>
>> Thank you!
>>
>> V
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to mojolicious+unsubscr...@googlegroups.com.
>> To post to this group, send email to mojolicious@googlegroups.com.
>> Visit this group at https://groups.google.com/group/mojolicious.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Using Mojolicious::Lite Syntax in Modules to Add Routes

2019-04-29 Thread Dan Book
No, the Lite DSL can only be imported into one "app" script for the "app".
However, you could call a function and pass it `app` or `app->routes` to
add routes to like a full app would.

-Dan

On Mon, Apr 29, 2019 at 2:15 PM Viktor Nacht  wrote:

> I have a fairly simple Mojo app where I just want to spin off the admin
> routes into a module but still use the Mojolicious::Lite syntax. I
> understand I could "grow" the app, but that would add a lot of extra files
> where I really just need to add one file.
>
> Is something like this possible? I tried the "obvious" approach but no
> luck.
>
> use Mojolicious::Lite;
> use MyApp::Admin;
>
> get '/public'
>
> app->start;
>
> package MyApp::Admin;
>
> use Mojolicious::Lite;
>
> get '/admin';
>
> The route /admin isn't added even though the module is found and processed
> (using FindBin). Any thoughts?
>
> Thank you!
>
> V
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


Re: [Mojolicious] Using Mojolicious::Lite Syntax in Modules to Add Routes

2019-04-29 Thread Stefan Adams
I don't have an answer for you, but I recommend checking out this related
talk, Mojolicious Gardening by Joel Berger
.

He has a sample lite-hybrid app

.

On Mon, Apr 29, 2019 at 1:15 PM Viktor Nacht  wrote:

> I have a fairly simple Mojo app where I just want to spin off the admin
> routes into a module but still use the Mojolicious::Lite syntax. I
> understand I could "grow" the app, but that would add a lot of extra files
> where I really just need to add one file.
>
> Is something like this possible? I tried the "obvious" approach but no
> luck.
>
> use Mojolicious::Lite;
> use MyApp::Admin;
>
> get '/public'
>
> app->start;
>
> package MyApp::Admin;
>
> use Mojolicious::Lite;
>
> get '/admin';
>
> The route /admin isn't added even though the module is found and processed
> (using FindBin). Any thoughts?
>
> Thank you!
>
> V
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


[Mojolicious] Using Mojolicious::Lite Syntax in Modules to Add Routes

2019-04-29 Thread Viktor Nacht
I have a fairly simple Mojo app where I just want to spin off the admin 
routes into a module but still use the Mojolicious::Lite syntax. I 
understand I could "grow" the app, but that would add a lot of extra files 
where I really just need to add one file. 

Is something like this possible? I tried the "obvious" approach but no luck.

use Mojolicious::Lite;
use MyApp::Admin;

get '/public'

app->start;

package MyApp::Admin;

use Mojolicious::Lite;

get '/admin';

The route /admin isn't added even though the module is found and processed 
(using FindBin). Any thoughts?

Thank you!

V

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.