diff options
author | Ingela Anderton Andin <[email protected]> | 2010-09-06 15:24:41 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2010-09-07 09:23:20 +0200 |
commit | a9b0039e971322b5ece78280e37df86b3ec0a843 (patch) | |
tree | 6583d15dd3196aa1d154ef6d4f763371f497a5a5 /lib/ssl/src/ssl_connection.erl | |
parent | 4763e0b7b8c4859d9e56f1fc9aa1426eebc8f65d (diff) | |
download | otp-a9b0039e971322b5ece78280e37df86b3ec0a843.tar.gz otp-a9b0039e971322b5ece78280e37df86b3ec0a843.tar.bz2 otp-a9b0039e971322b5ece78280e37df86b3ec0a843.zip |
Add missed DER dh option.
Diffstat (limited to 'lib/ssl/src/ssl_connection.erl')
-rw-r--r-- | lib/ssl/src/ssl_connection.erl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl index 7689976ff6..c94199c336 100644 --- a/lib/ssl/src/ssl_connection.erl +++ b/lib/ssl/src/ssl_connection.erl @@ -1034,7 +1034,7 @@ ssl_init(SslOpts, Role) -> PrivateKey = init_private_key(SslOpts#ssl_options.key, SslOpts#ssl_options.keyfile, SslOpts#ssl_options.password, Role), - DHParams = init_diffie_hellman(SslOpts#ssl_options.dhfile, Role), + DHParams = init_diffie_hellman(SslOpts#ssl_options.dh, SslOpts#ssl_options.dhfile, Role), {ok, CertDbRef, CacheRef, OwnCert, PrivateKey, DHParams}. @@ -1111,11 +1111,13 @@ file_error(Line, Error, Reason, File, Throw, Stack) -> error_logger:error_report(Report), throw(Throw). -init_diffie_hellman(_, client) -> +init_diffie_hellman(Params, _,_) when is_binary(Params)-> + public_key:der_decode('DHParameter', Params); +init_diffie_hellman(_,_, client) -> undefined; -init_diffie_hellman(undefined, _) -> +init_diffie_hellman(_,undefined, _) -> ?DEFAULT_DIFFIE_HELLMAN_PARAMS; -init_diffie_hellman(DHParamFile, server) -> +init_diffie_hellman(_, DHParamFile, server) -> try {ok, List} = ssl_manager:cache_pem_file(DHParamFile), case [Entry || Entry = {'DHParameter', _ , _} <- List] of |