aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-03-01 15:36:55 +0100
committerIngela Anderton Andin <[email protected]>2013-03-05 13:04:10 +0100
commitbfb408ae3d424bf8f510806434eb14a730adc4fb (patch)
treefed3d553b459b128212832b441118ea9c5d8f967 /lib/ssl/src/ssl.erl
parent8183fcfb059794823a8289456d68b20a80d9a1b4 (diff)
downloadotp-bfb408ae3d424bf8f510806434eb14a730adc4fb.tar.gz
otp-bfb408ae3d424bf8f510806434eb14a730adc4fb.tar.bz2
otp-bfb408ae3d424bf8f510806434eb14a730adc4fb.zip
ssl: Check that negotiated version is a supported version.
Diffstat (limited to 'lib/ssl/src/ssl.erl')
-rw-r--r--lib/ssl/src/ssl.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index 0ba59cede2..fc06b5f1b0 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -612,8 +612,15 @@ handle_options(Opts0, _Role) ->
CertFile = handle_option(certfile, Opts, <<>>),
+ Versions = case handle_option(versions, Opts, []) of
+ [] ->
+ ssl_record:supported_protocol_versions();
+ Vsns ->
+ [ssl_record:protocol_version(Vsn) || Vsn <- Vsns]
+ end,
+
SSLOptions = #ssl_options{
- versions = handle_option(versions, Opts, []),
+ versions = Versions,
verify = validate_option(verify, Verify),
verify_fun = VerifyFun,
fail_if_no_peer_cert = FailIfNoPeerCert,