Configuring Erlang to work with SSL

吃可爱长大的小学妹 提交于 2019-12-12 07:49: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.

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?


回答1:


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



来源:https://stackoverflow.com/questions/2207384/configuring-erlang-to-work-with-ssl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!