Stunnel

De Wiki Clusterlab.com.br
Revisão de 19h49min de 19 de maio de 2022 por Damato (discussão | contribs) (Criou página com '<syntaxhighlight lang=bash> #/ ___|_ _| | | | \ | | \ | | ____| | #\___ \ | | | | | | \| | \| | _| | | # ___) || | | |_| | |\ | |\ | |___| |___ #|____/ |_| \___/|_| \_...')
(dif) ← Edição anterior | Revisão atual (dif) | Versão posterior → (dif)
Ir para navegação Ir para pesquisar
#/ ___|_   _| | | | \ | | \ | | ____| |
#\___ \ | | | | | |  \| |  \| |  _| | |
# ___) || | | |_| | |\  | |\  | |___| |___
#|____/ |_|  \___/|_| \_|_| \_|_____|_____|
#
yum install -y stunnel

cat << EOF > /etc/stunnel/commands
openssl genrsa -out key.pem 2048
openssl req -new -x509 -key key.pem -out cert.pem -days 3650
cat key.pem cert.pem >> /etc/stunnel/stunnel.pem

EOF

cd /etc/stunnel ; sh /etc/stunnel/commands

cat << EOF > /etc/stunnel/stunnel.conf
; **************************************************************************
; * Global options *
; **************************************************************************
; Debugging stuff (may be useful for troubleshooting)
debug = info
output = stunnel.log
; foreground = yes
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
client = yes
cert = /etc/stunnel/stunnel.pem
sslVersion = TLSv1.2
options = NO_SSLv2
options = NO_SSLv3
; **************************************************************************
; * Service definitions (at least one service has to be defined) *
; **************************************************************************
[myapp]
accept = 127.0.0.1:12345
connect = remote.app.com:12345

EOF