【问题标题】:Ejabberd with haproxy ssl termination具有 haproxy ssl 终止的 Ejabberd
【发布时间】:2018-03-19 04:46:17
【问题描述】:

有人用 haproxy 1.7 通过 ejabberd + ssl 终止成功了吗?

frontend ejabberd   
bind *:4000 ssl crt /etc/haproxy/certs/my-domain.com.pem
mode tcp
timeout client  3h

option tcplog

option clitcpka

default_backend ejabberd

backend ejabberd
mode tcp

timeout server  60m 

option redispatch

option srvtcpka

option independent-streams

balance leastconn

default-server inter 5s rise 3 fall 3 on-marked-down shutdown-sessions

server ejabberd localhost:5222 check slowstart 120s

没有 ssl crt 也能正常工作。我的 smack 客户给了我一个No response received within reply timeout. Timeout was 5000ms (~5s). While waiting for establishing TLS.

我也尝试过在 ejabberd conf 上使用或不使用 ttls

【问题讨论】:

    标签: ssl ejabberd haproxy


    【解决方案1】:

    我能够让确切的配置正常工作,您需要:

    1. 在 ejabberd 中禁用 tls,因为 HAProxy 正在执行 ssl 卸载并且 ejabberd 托管在同一台机器上:

      • 注释 certfile 行
      • 注释 starttls 行
    2. 正确地配置你的客户端,我用过 pidgin,但是你应该可以用 smack 做同样的事情:

      • 正确配置地址和端口(这里是4000)
      • 确保您使用“旧式 TLS”而不是 STARTTLS,后者无法与 HAProxy 一起使用。

    否则,如果您希望客户端使用 STARTTLS 配置,那么您必须配置 HAProxy 来代理 XMPP 加密流量(删除“ssl crt ..”)

    【讨论】:

    • 你不能配置 haproxy 来阻止 starttls 对吧?一起配置 smack 和 xmppframework 很痛苦
    • 这不是关于阻止 starttls,而是关于选择 HAProxy 应该处理的 TLS 机制。 XMPP 客户端使用 starttls,然后您必须删除“ssl crt ..”,或者客户端使用旧式 TLS,然后您可以在 HAProxy 中保留“ssl crt ..”并在 ejabberd 中禁用 TLS
    猜你喜欢
    • 1970-01-01
    • 2021-11-27
    • 2017-07-04
    • 1970-01-01
    • 2017-08-12
    • 1970-01-01
    • 2012-09-29
    • 1970-01-01
    • 2012-08-16
    相关资源
    最近更新 更多