【问题标题】:Send request with self signed certificates to backend将带有自签名证书的请求发送到后端
【发布时间】:2017-04-08 21:39:07
【问题描述】:

Haproxy 文档 (http://cbonte.github.io/haproxy-dconv/1.7/intro.html#3.3.2) 将其列为基本功能:

与后端服务器的身份验证让后端服务器实际上是连接到它的预期 haproxy 节点

我一直试图做到这一点,但一直无法做到。那么问题来了:

如何使用自签名证书向后端发送请求以进行身份​​验证。 uses这个后端的前端请求,只是http。

这是我的 haproxy.cfg 文件:

global
    maxconn 4096
    daemon
    log 127.0.0.1 local0

defaults
    log     global
    option  dontlognull
    retries 3
    option redispatch
    maxconn 2000
    timeout connect 5s
    timeout client  15min
    timeout server  15min

frontend public
    bind *:8213
    use_backend api if { path_beg /api/ }
    default_backend web

backend web
    mode http
    server blogweb1 127.0.0.1:4000

backend api
    mode tcp
    acl clienthello req.ssl_hello_type 1

    tcp-request inspect-delay 5s
    tcp-request content accept if clienthello

    server blogapi  127.0.0.1:8780

【问题讨论】:

  • 请在配置中显示您正在尝试的内容。不过,首先,无需身份验证即可使用它,证书安装在后端,代理服务器使用server 行中的ssl verify none 无需身份验证即可连接。

标签: haproxy


【解决方案1】:

我最终得到了这个开始工作。我相信让我失望的是,在执行haproxy -f <configFile> -st 之后,它实际上并没有像我想象的那样关闭进程。因此,我没有进行任何更改/更新。我kill -9数十个haproxy服务并重新运行命令(haproxy -f),现在它正在工作。

现在,这是一个假设,尽管我对此非常有信心。我仍然会展示我的最终配置,以防有人从这里收集到一些东西。我用https://www.haproxy.com/doc/aloha/7.0/deployment_guides/tls_layouts.html。该链接回答了我的“如何使用 ssl 对后端进行身份验证”的问题,就像文档说的那样。

global
    maxconn 4096
    daemon
    log 127.0.0.1 local0

defaults
    log     global
    option  dontlognull
    retries 3
    option redispatch
    maxconn 2000
    timeout connect 5s
    timeout client  15min
    timeout server  15min

frontend public
    bind *:443
    mode http
    use_backend api if { path_beg /api/ }

backend api
    mode http
    option httplog
    server blogapi  127.0.0.1:4430 ssl ca-file <caFile.Pem> crt <clientCert.pem> verify required

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-21
    • 2019-05-13
    • 2012-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多