mwb613 has asked for the wisdom of the Perl Monks concerning the following question:
This code runs w/o error, however, as soon as I try to connect via a simple client the daemon quits (again w/o error -- though I'm unsure where to trap an error w/o overloading the module). Here is the client script:my $ssl_key_path = '/etc/pki/tls/private/ca.key'; my $ssl_cert_path = '/etc/pki/tls/cert.pem'; my $port = $ARGV[0]; $port = 88888 unless $port; my $server = JSON::RPC::Server::Daemon->new( LocalAddr => '127.0.0.1', LocalPort => $port, SSL_key_file => $ssl_key_path, SSL_cert_file => $ssl_cert_path, SSL_verify_mode => 0 ) || die "failed to listen: $!"; $server->dispatch({'/test' => 'myApp'}); $server->handle();
Prior to trying to implement SSL I was having no problems sending requests and responding to them. I based my SSL cert lines in the Daemon constructor on the IO::Socket:SSL documentation. Has anyone been able to get SSL to work with the JSON::RPC::Server::Daemon module? I've noticed there is not much documentation or example code on the web which leads me to think people might be using other alternatives for this type of job. Thanks for your time!#!/usr/bin/perl use JSON::RPC::Client; my $client = new JSON::RPC::Client; $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0; my $port = $ARGV[0]; $port = 88888 unless $port; my $uri = 'https://127.0.0.1:'.$port.'/test'; my $obj = { method => 'get_ticket_info', # or 'MyApp.sum' params => [105195,555435], }; my $res = $client->call( $uri, $obj );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: JSON::RPC::Server with SSL
by zentara (Cardinal) on Mar 11, 2014 at 15:39 UTC | |
by mwb613 (Beadle) on Mar 11, 2014 at 19:45 UTC | |
by hazylife (Monk) on Mar 11, 2014 at 20:31 UTC | |
by mwb613 (Beadle) on Mar 11, 2014 at 21:15 UTC | |
by zentara (Cardinal) on Mar 12, 2014 at 10:03 UTC | |
|