Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring Erlang to work with SSL

Tags:

ssl

erlang

Erlang version: R13B01

Currently I'm struggling trying to make Erlang work with SSL. The programming part was easy, but now starting the system SSL-enabled is not.

Following the Erlang SSL documentation:

1 - Made the start_ssl.rel file

{release, {"OTP  APN 181 01","R13B01"}, {erts, "5.7.2"},
 [{kernel,"2.13.2"},
  {stdlib,"1.16.2"},
  {sasl,"2.1.6"},
  {os_mon,"2.2.2"},
  {ssl,"3.10.3"}]}.

2 - Executed the following command

1> systools:make_script("start_ssl",[]).

According to the documentation, running the shell would output this (this output is from docs, not mine):

$ erl -boot /home/me/ssl/start_ssl
Erlang (BEAM) emulator version 5.0

Eshell V5.0  (abort with ^G)
1> whereis(ssl_server).
<0.32.0>

But, I'm receiving this instead:

erl -boot start_ssl
Erlang R13B01 (erts-5.7.2) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]
1> whereis(ssl_server).
undefined
2> 

So, for now, the remaining steps are failing too. Sadly, there is no documentation nor forum threads around the web with the same issue.

Any tips?

like image 721
scooterman Avatar asked Feb 05 '10 13:02

scooterman


1 Answers

Well, after some try and error, I've managed to start the system:

application:start(ssl)

and passing all certificates when creating the listening socket

ssl:listen(Port, ?TCP_OPTIONS ++ [{ip, Host},{verify, 0},
                                       {depth,  0}, 
                                       {cacertfile, Cacertfile}, 
                                       {certfile,   Certfile},
                                       {keyfile,    Keyfile}]) 

It worked :)

like image 197
scooterman Avatar answered Nov 19 '22 14:11

scooterman