haproxy的自签名证书导致不安全连接的chrome警告

我尝试使用haproxy作为testing台来设置SSL终止。 它很好地服务于80端口的testing页面,但是在443端口chrome显示ssl连接不安全的警告,以及https通过的图标。

我用这些命令创build了证书:

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout web.key -out web.crt cat web.crt web.key > web.pem 

通用名称定义为haproxy.com

另外我把haproxy.com放到我的/etc/hosts文件中

这是haproxy的摘录:

 frontend main bind *:80 bind *:443 ssl crt /root/web.pem mode http default_backend app backend app balance roundrobin server app1 127.0.0.1:8080 check server app2 127.0.0.1:8081 check 

我怎样才能pipe理这个警告?

自签名证书不受任何浏览器的信任,因为您是签名而不是证书颁发机构。 您可以在浏览器的信任存储中导入根证书,但这只会使您的连接成为可信的连接,而其他连接将收到相同的警告消息。