# Compile and install OpenSSL - via https://github.com/haproxy/haproxy/blob/master/README wget -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz tar -zxf /tmp/openssl.tgz -C /tmp cd /tmp/openssl-* ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic make make install_sw
接著,重新編譯 HAProxy 1.6.3 使用 OpenSSL。
Terminal
1 2 3 4 5 6 7 8 9
# Compile and install HAProxy wget -O /tmp/haproxy.tgz https://www.haproxy.org/download/1.6/src/haproxy-1.6.3.tar.gz tar -zxvf /tmp/haproxy.tgz -C /tmp cd /tmp/haproxy-* make \ TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \ USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-ldl \ CFLAGS="-O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18" make install
global #debug chroot /var/lib/haproxy user haproxy group haproxy pidfile /var/run/haproxy.pid
# Default SSL material locations ca-base /etc/ssl/certs crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets. ssl-default-bind-options no-sslv3 no-tls-tickets force-tlsv12 ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS