开发者

Configuring Erlang to work with SSL

开发者 https://www.devze.com 2022-12-19 01:19 出处:网络
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.

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 doc开发者_运维百科umentation:

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?


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 :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号