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 );
In reply to JSON::RPC::Server with SSL by mwb613
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |