配置 Erlang 以使用 SSL

发布于 2024-08-20 08:27:27 字数 984 浏览 4 评论 0原文

Erlang 版本:R13B01

目前我正在努力让 Erlang 与 SSL 一起工作。编程部分很简单,但现在启动启用 SSL 的系统却不容易。

遵循 Erlang SSL 文档

1 - 创建 start_ssl.rel 文件

{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 - 执行以下命令

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

根据文档,运行 shell 将输出以下内容(此输出来自文档,而不是我的):

$ 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>

但是,我收到的是:

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> 

因此,目前,其余步骤也失败了。遗憾的是,网络上没有出现相同问题的文档或论坛帖子。

有什么建议吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不弃不离 2024-08-27 08:27:27

好吧,经过一些尝试和错误,我成功启动了系统:

application:start(ssl)

并在创建侦听套接字时传递了所有证书

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

它起作用了:)

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文