… | |
… | |
19 | |
19 | |
20 | # node configuration: TLS |
20 | # node configuration: TLS |
21 | aemp setcert <file> # set a certificate (key.pem + certificate.pem) |
21 | aemp setcert <file> # set a certificate (key.pem + certificate.pem) |
22 | aemp clrcert # remove certificate |
22 | aemp clrcert # remove certificate |
23 | aemp gencert # generate a random certificate |
23 | aemp gencert # generate a random certificate |
24 | aemp forcetls <0|1> # enforce TLS connections? |
|
|
25 | |
24 | |
26 | =head1 DESCRIPTION |
25 | =head1 DESCRIPTION |
27 | |
26 | |
28 | With aemp you can configure various aspects of AnyEvent::MP and it's protocol. |
27 | With aemp you can configure various aspects of AnyEvent::MP and it's protocol. |
29 | |
28 | |
… | |
… | |
184 | |
183 | |
185 | "$cert$key" |
184 | "$cert$key" |
186 | } |
185 | } |
187 | |
186 | |
188 | our $cfg = \%AnyEvent::MP::Config::CFG; |
187 | our $cfg = \%AnyEvent::MP::Config::CFG; |
189 | our $nodecfg = $cfg->{node}{"#default"} ||= {}; |
188 | our $nodecfg = $cfg; |
190 | |
189 | |
191 | sub resolve_port { |
190 | sub resolve_port { |
192 | my ($node, $port) = split /#/, $_[0], 2; |
191 | my ($node, $port) = split /#/, $_[0], 2; |
193 | |
192 | |
194 | $node = (resolve_node $node)->recv; |
193 | $node = (resolve_node $node)->recv; |
… | |
… | |
251 | }, |
250 | }, |
252 | clrcert => sub { |
251 | clrcert => sub { |
253 | delete $nodecfg->{cert}; |
252 | delete $nodecfg->{cert}; |
254 | ++$cfg->{dirty}; |
253 | ++$cfg->{dirty}; |
255 | }, |
254 | }, |
256 | forcetls => sub { |
|
|
257 | @ARGV == 1 |
|
|
258 | or die "enable value missing\n"; |
|
|
259 | |
|
|
260 | $nodecfg->{forcetls} = !!shift @ARGV; |
|
|
261 | ++$cfg->{dirty}; |
|
|
262 | }, |
|
|
263 | ); |
255 | ); |
264 | |
256 | |
265 | sub docmd { |
257 | sub docmd { |
266 | my $cmd = shift @ARGV; |
258 | my $cmd = shift @ARGV; |
267 | |
259 | |