[erlang-questions] how to get ssl communication between nodes - windows erlsrv script

Wes James comptekki@REDACTED
Wed Feb 13 00:27:01 CET 2013


I got it to work by putting .erlang.cookie in c:\windows.

In my testing I had put a file there previously, but it wouldn't be read if
the file wasn't set to readonly.

Thanks,

wes


On Tue, Feb 12, 2013 at 2:17 PM, Dave Cottlehuber <dch@REDACTED> wrote:

> Last time I looked at the source workdir wasn't for changing where the
> cookie got read from.
>
> But you should be able to load the cookie & start the network
> programatically, something like this, starting up in non-distributed
> mode:
>
>     net_kernel:start([<newname>]). %% uses longnames by default
>     net_kernel:start([<newname>, shortnames]). %% if you prefer shortname.
>     erlang:set_cookie(node(), yumyumyum). %% yes it's an atom.
>
> This has the added bonus of being able to stash your cookie in an
> encrypted form either on disk or in the beam.
>
> Let me know if this works out, I haven't tried it but use similar
> things for monitoring.
>
> And I'm one of those closet Erlang Windows users too.
>
> A+
> Dave
>
> On 12 February 2013 22:11, Wes James <comptekki@REDACTED> wrote:
> > I was able to get ssl communication between nodes on linux.  Here is a
> > windows .cmd script for installing erlsrv with ssl communication:
> >
> > @rem
> > @rem sample erlang install service script
> > @rem - add then start ecom erlang service
> > @rem - if it already exists, stop then remove first before adding and
> > starting
> > @rem
> >
> > @set erl_service=my_service
> > @erlsrv list %erl_service% | @findstr /i "%erl_service%"
> > @echo.
> > @if errorlevel 1 goto install
> > @rem echo Stopping and removing erl service...
> > @erlsrv remove "%erl_service%"
> >
> > :install
> > @set module=-s my_module
> > @set onfail=-onfail restart
> > @set node=-name node_name
> > @set root=-w "C:/path"
> > @set srvc_name=-i my_service
> > @set boot=-boot c:/path/start_ssl_ecom -proto_dist inet_tls -ssl_dist_opt
> > server_certfile c:/path/ssl/cert.pem -ssl_dist_opt server_keyfile
> > c:/path/ssl/key.pem -ssl_dist_opt server_secure_renegotiate true
> > client_secure_renegotiate true
> > @set cookie=-setcookie my_cookie
> > @set args=-args "%boot% %cookie% %module%"
> >
> > @echo.
> > @rem echo Adding erl service...
> > @erlsrv add "%erl_service%" %node% %root% %onfail% %args%  %srvc_name%
> > @echo.
> > @rem echo Starting erl service...
> > @erlsrv start %erl_service%
> > @echo.
> > @pause
> >
> > Now if I can figure out why it's not picking up the .erlang.cookie from
> -w
> > path, I'll be able to remove the -setcookie option.  I've tried putting
> the
> > .erlang.cookie in a lot of different places to see if it gets read - no
> dice
> > yet.  I have been able to get .erlang.cookie created in my windows
> profile
> > c:/users/username when I run erl -name, but not yet with erlsrv.
> >
> > I'm excited to get ssl working.  I have wanted it working for
> > https://github.com/comptekki/esysman so I can send commands encrypted
> and
> > not in the clear.
> >
> > Thanks to all that have contributed to my questions about this!
> >
> > wes
> >
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130212/e0b1aa5f/attachment.htm>


More information about the erlang-questions mailing list