This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Originally from: http://erlang.org/pipermail/erlang-questions/2017-August/093170.html | |
For a safe and fast Erlang SSL server, there's a few | |
configuration values you might want by default: | |
[{ciphers, CipherList}, % see below | |
{honor_cipher_order, true}, % pick the server-defined order of ciphers | |
{secure_renegotiate, true}, % prevent renegotiation hijacks | |
{client_renegotiation, false}, % prevent clients DoSing w/ renegs | |
{versions, ['tlsv1.2', 'tlsv1.1']}, % add tlsv1 if you must |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
term_handler() { | |
echo "Stopping the server process with PID $PID" | |
erl -noshell -name "term@127.0.0.1" -eval "rpc:call('app@127.0.0.1', init, stop, [])" -s init stop | |
echo "Stopped" | |
} | |
trap 'term_handler' TERM INT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
require 'digest/sha1' | |
require 'base64' | |
require 'json' | |
def go_demo! | |
key = Digest::SHA1.hexdigest("clave1")[0..15] # 16bytes => 128bits | |
iv = 'clave2 con chicha'[0..15] # 16bytes forced | |
data = { esto: 'es', un: 'hash', en: 'ruby' } |